We solved a similar problem by creating a view that calculated the field 
instead of using a transient field.

Then we just mapped the view as a read only object and all the sorting worked.

-Tony

On Jul 11, 2011, at 7:28 PM, Richard Yunhua Sang wrote:

> Thanks for your reply, but I do want to sort the result by transient field
> in Grid. It would be appreciated that the JPAGridDataSource is able to sort
> the result within JVM.
> 
> On Mon, Jul 11, 2011 at 5:29 PM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
> 
>> On Mon, 11 Jul 2011 18:06:17 -0300, Richard Yunhua Sang <
>> yunhua.s...@gmail.com> wrote:
>> 
>> Hi there,
>>> 
>> 
>> Hi!
>> 
>> 
>> I am using a Grid with JpaGridDataSource; when I click sort icon on a
>>> transient field of an entity, I get following exception:
>>> 
>> 
>> I don't think any GridDataSource implementation backed by a database would
>> be able to handle transient properties, so you should set their
>> corresponding PropertyModel's as unsortable. To get the PropertyModel,
>> create a BeanModel for you entity class using the BeanModelSource service
>> and use its get() method.
>> 
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to