On 29.10.2012 12:51, membersound wrote:
OK I see. I'm doing it with BeanModelSource based on this example:
http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/gridmodel1


Would you recommend me switching to a GridDataSource in my page class for
providing the data instead of a list and a BeanModel? Especially regarding
to the following example case:
So the List is the GridDataSource in your case. This is a fine example of tapestry "magic". Tapestry coerces the List to a GridDataSource. Read about Type Coercion here http://tapestry.apache.org/type-coercion.html. See full list of coercions tapestry provides here http://tapestry.apache.org/typecoercer-service.html. the coercion I mentioned is documented in the page like this
java.util.Collection --> org.apache.tapestry5.grid.GridDataSource

If you want to persist you data just use @Persist on the list and don't recreate the list each time the grid is rendered (for example in setupRender).


Image a User object with a list. I later want to display the user, and the
size of the list.
I tried the following, which does not work obviously but you get the idea:


BeanModel model;
model.add("products count", PropertyConduitSource.create(User.class,
"products.size()"));

class User {
        List<Product> products;
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Retain-BeanModel-when-sorting-columns-tp5717374p5717379.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


Reply via email to