Hi,
I don't use 5.2, but it seems based on your code this should work (I do
this in 5.1.0.5):
ColumnSort colSort = _grid.getSortModel().getColumnSort("txnId");
while(!colSort.equals(ColumnSort.DESCENDING)){
_grid.getSortModel().updateSort("txnId"); //Should invert the sort
colSort = _grid.getSortModel().getColumnSort("txnId");
debug("\n\nColumnSort for txnId after one call to updateSort is: " + colSort
+ "\n");
}
-Rich
On 10/20/2010 08:41 AM, Darren Williams wrote:
Hi, we have been trying to work out a way to set the default sort order on our
BeanModel to descending by default, since this is what out SQL query does but
it appears as though the grid does not expose this method as shown below.
Is there another way we can do this? All the examples I have seen before 5.2
use this technique, but 5.2 has made this method private.
public BeanModel getBeanModel() {
//setup the model for this user
if (beanModel == null) {
beanModel=beanModelSource.createDisplayModel(License.class, messages);
beanModel.include("entered","endDate");
//sorting
if (_grid.getSortModel().getSortConstraints().isEmpty()
) {
_grid.getSortModel().updateSort("entered");
//this is still not exposed in tapestry 5.2 so
you can't change order
//_grid.setSortAscending(false);
}
}
return beanModel;
}
regards, Darren
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]