You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2008/02/25 00:48:40 UTC
[Tapestry Wiki] Update of "Tapestry5GridComponent" by GabrielLandais
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The following page has been changed by GabrielLandais:
http://wiki.apache.org/tapestry/Tapestry5GridComponent
The comment on the change is:
Tried to answer questions
------------------------------------------------------------------------------
== How to disable sorting for a column ==
It is very likely possible to disable sorting for a column. How is that done?
+ One solution is to create a specific BeanModel for your Grid :
+
+ * Template part :
+ {{{
+ <t:grid t:source="list" model="model"/>
+ }}}
+
+ * Java part :
+
+ {{{
+ /** The model. */
+ @Retain
+ private BeanModel model;
+
+ /** The bean model source. */
+ @Inject
+ private BeanModelSource beanModelSource;
+
+ /** The resources. */
+ @Inject
+ private ComponentResources resources;
+
+ /**
+ * Page loaded.
+ */
+ void pageLoaded() {
+ BeanModel model = beanModelSource.create(Entity.class, false, resources);
+ model.get("XXX").sortable(false);
+ }
+
+ }}}
== How to define the initial sort column ==
- ???
+ TODO not tested
+
+ * Template part :
+
+ {{{
+ <t:grid t:source="list" t:id="theGrid"/>
+ }}}
+
+ * Java part :
+
+ {{{
+ /** The form. */
+ @Component
+ private Grid theGrid;
+
+ @SetupRender
+ public void setupGrid() {
+ theGrid.updateSort("XXX");
+ }
+
+ }}}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org