aspose file tools*
The moose likes Struts and the fly likes Problem in using display tag sorting with Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in using display tag sorting with Struts" Watch "Problem in using display tag sorting with Struts" New topic
Author

Problem in using display tag sorting with Struts

Charanjit Sidhu
Greenhorn

Joined: Apr 04, 2005
Posts: 13
Hi,

I have a requirement of a table on a screen with the option of sorting on all columns. I was thinking that display tag will be a nice solution. But sorting is not working as the sorting link points to the JSP and my JSP is under WEB-INF and additionally in Struts we should always go through 'actions'.

I have the following in my JSP:
<display:column property="loanNumber" title="Loan #" sortable="true"/>

and the generated link on field 'Loan #' is:

http://host:7001/webapp/WEB-INF/layout/layout.jsp?d-16544-s=1&d-16544-o=2

Is there a solution to this problem or I will have to drop the idea of using Display tag for this requirement?

Thanks!


Charanjit Sidhu<br />SCJP 81%
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I haven't really used the display tag library, so I couldn't help you much with information on what it does or doesn't do. If it needs to redisplay the page in the manner you've described, though, it doesn't look like it's going to work in your situation.

I've been using WebFX Sortable Table to sort my tables. This is an all javaScript solution that does not require the page to be submitted or redisplayed. If you determine that the display tags aren't going to work for you, you might give sortable table a try.
[ February 22, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Hugh Heff
Greenhorn

Joined: Jul 17, 2008
Posts: 1
You need to set the requestURI parameter.
e.g. for the action called 'layout':
<display:table .... requestURI="layout.action" ....>

where .... is whatever other parameters you have in the display table tag.

Enjoy,
Heff
Kenneth J Medlock
Greenhorn

Joined: Jul 15, 2005
Posts: 1
I was having exactly the same issue. Thanks for the fix.


Ken Medlock<br />Analyst/Programmer/Katie's Dad
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in using display tag sorting with Struts