tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tapestry Wiki] Update of "Tapestry5GridComponent" by JesperZedlitz
Date Sat, 01 Mar 2008 20:36:36 GMT
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 JesperZedlitz:
http://wiki.apache.org/tapestry/Tapestry5GridComponent

The comment on the change is:
How to add a sortable column

------------------------------------------------------------------------------
  {{{
  public class Page {
    @Inject
-   private BeanModelSource _beanModelSource;
+   private BeanModelSource beanModelSource;
    @Inject
-   private ComponentResources _resources;
+   private ComponentResources resources;
-   private final BeanModel _model;
+   private BeanModel model;
  
    void pageLoaded() {
-     this._model = _beanModelSource.create(Person.class, true, _resources);
+     this.model = beanModelSource.create(Person.class, true, resources);
-     thisl_model.add("details", null);
+     this.model.add("details", null);
    }
    ...
  }}}
  
  for details see http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Grid.htmlAdding%20Columns%20Example
+ 
+ == How to add a sortable column ==
+ With the above code the column will not be sortable. To make it sortable use
+ {{{
+   this.model.add("details",null).sortable(true);
+ }}}
  
  == How to disable sorting for a column ==
  It is very likely possible to disable sorting for a column. How is that done?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message