Yes indeed, Catalysts has moved, but that doesn’t mean we are gone, we just moved to our new website
together with our partners from Crisp Research to do the same things we used to do in an improved way. We still do great software and we are still great people, more or less only the color has changed except from our domain 😉

Tapestry: How to make Grid “add”ed columns sortable

In Tapestry Grids, “add”ed columns are not sortable by default. The following is one way to enable sorting for grid columns that are “add”ed:

  1. In the @Component annnotation of your grid add this parameter:

  2. Add a method as follows to your class which contains the grid:
    public BeanModel getModel()

  3. Inject the BeanModelSource to your class which contains the grid, as follows:
    private BeanModelSource beanModelSource;
  4. In your getModel() method create a BeanModel as follows:
    final BeanModel model =

    Where “YourRowClass” is the class you’ve specified for your row parameter of your Grid component.

  5. In the getModel() method you also need to do your “include”, “add” and “reorder” (in that order). Note: This can’t be done as component parameters because you need to modify the “add” PropertyModels (see next step).
  6. For each of your “add”s create a PropertyModel and call sortable(true). Note that for each of your “add”s you need to include a property conduit to return the appropriate value (by overriding the get(Object instance) method). Example:
    final PropertyModel appointmentModel = model.add("appointment",

Here is some example source code for the full getModel() method:

 * @return model with sortable columns
public BeanModel getModel()
    final BeanModel model =

    model.include("propertyName1", "propertyName2", "propertyName3");

    final PropertyModel pm1 = model.add("propertyName4", 

    final PropertyModel pm2 = model.add("propertyName5", 

    model.reorder("propertyName1", "propertyName2", 
        "propertyName3", "propertyName4", "propertyName5");

    return model;

I’d hazard a guess that this would be a candidate for an improvement in a future tapestry version i.e. an easier/less verbose way to make “add”ed columns sortable.

P.S. If you’re aware of a better way to achieve this feel free to add a comment below.

Previous Post bedankt sich bei Catalysts mit dem JOB NAVI³ Award
Next Post
Adieu, Ottensheimer Straße!

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed