struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robinbajaj <robinba...@gmail.com>
Subject Re: [OT] problem with displaytag column sorting in struts 1.2 web project
Date Sun, 08 Apr 2007 19:59:38 GMT

thanks for the tip.
can you please provide more specific example/code-snippet for using the 
requestURI attribute. i couldnt find enough documentation on this feature. 
thanks in advance, 
robin


Tim Williams wrote:
> 
> On 4/8/07, robin bajaj <robinbajaj@gmail.com> wrote:
>> Hi All,
>> In my Struts 1.2.x webapp, I am getting some Patient records from
>> backend using my PatientManager businessObject (which uses Hibernate)
>> to send back a populated Patients List in the request scope. (Patient is
>> my bean).
>>
>> I am feeding this patientsList to Displaytag table,
>> to show the data in a table.
>>
>> Here's the code snippet for my jsp containing displaytag table.
>> http://rafb.net/p/artIJr98.html
>>
>> Now, I want to sort this table based on the PatientID
>> when I click on the PatientID column.
>>
>> I read in the Displaytag docs
>>
>> http://displaytag.homeip.net/displaytag-examples-1.1/example-sorting.jsp
>>
>> where it mentions the following :
>>
>> If you want to allow the user to sort the data as it is coming back,
>> then you need to just do two things, make sure that the data returned
>> from your property implements the Comparable interface (if it doesn't
>> natively - use the decorator pattern as shown a couple of examples ago),
>> and then set the attribute sortable="true" on the columns that you want
>> to be able to sort by.
>>
>>
>> Following the above suggestion, I changed my Patient class to implement
>> Comparable interface and implemented the following compareTo method (as
>> following)
>> http://rafb.net/p/t0CR4Q98.html
>>
>> Then I re-build my app and restart it on the server, the displaytag
>> table shows up fine. But when I click on the first column PtId, it
>> doesn't sort the table. I just get the Http404 error page.
>>
>> Am I missing something ?
> 
> Try setting the requestURI attribute of the table itself?
> --tim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-OT--problem-with-displaytag-column-sorting-in-struts-1.2-web-project-tf3543922.html#a9895137
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message