PS - DBObjectDetachableModel is my own model wrapper - you could use plain
Model, but I'd suggest looking at:
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/

On Thu, Jan 8, 2009 at 4:00 PM, Jeremy Thomerson
<jer...@wickettraining.com>wrote:

> What kind of data provider are you giving it?  Couldn't you implement your
> own ISortableDataProvider?
>
>         ISortableDataProvider<Post> dp = new SortableDataProvider<Post>() {
>             public Iterator<? extends Post> iterator(int first, int count)
> {
>                 // TODO Auto-generated method stub
>                 // use this property to determine if that's the column
> selected.  then sort by it
>                 getSort().getProperty();
>                 return null;
>             }
>             public IModel<Post> model(Post object) {
>                 return new DBObjectDetachableModel<Post>(object);
>             }
>             public int size() {
>                 // TODO Auto-generated method stub
>                 return 0;
>             }
>         };
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
> On Thu, Jan 8, 2009 at 3:32 PM, nitinkc <nitin_chan...@yahoo.com> wrote:
>
>>
>> As I had mentioned, the column values are not representative of the values
>> of
>> any property so that would not work....
>>
>>
>> asfernandes wrote:
>> >
>> > nitinkc wrote:
>> >> I have a requirement to sort a column of a Datatable which does not
>> have
>> >> any
>> >> property values. Sorting property columns is easy using the
>> >> getSortProperty() method. However in this case, I am populating the
>> >> values
>> >> in the column using the
>> >>
>> >> populateItem(org.apache.wicket.markup.repeater.Item cellItem,
>> >>                     java.lang.String componentId,
>> >>                     org.apache.wicket.model.IModel rowModel)
>> >>
>> >> method. The column values are generated using additional logic in this
>> >> method and are not representative of any property value. Any ideas??
>> >>
>> > The second parameter of PropertyColumn constructor is the property used
>> > for sorting.
>> >
>> >
>> > Adriano
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Sorting-a-column-populated-through-pupulateItem-method...-tp21337870p21361414.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com

Reply via email to