On 4/8/07, robin bajaj <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to