thanks. It certainly works. Just seems like a hack for something so simple.
On Oct 20, 2010, at 9:38 AM, Josh Canfield wrote:
> If you want to you can provide a custom sort model, it's a pretty
> simple interface.
>
> Alternatively, if all you want to do is start with sort descending
> then you could just do this:
>
> _grid.getSortModel().updateSort("entered"); // sorts ascending
> _grid.getSortModel().updateSort("entered"); // now sorts descending
>
> ugly, but effective.
>
> On Wed, Oct 20, 2010 at 5:41 AM, Darren Williams <[email protected]> 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]
>
_____________________
Darren Williams
LiveTime Software Inc.
http://www.livetime.com
(949) 777 5800
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]