Solved

JSTL DisplayTag Back Button Issue

Posted on 2013-01-31
3
787 Views
Last Modified: 2013-03-27
I am using displaytag with Apache/Tomcat JSTL.  It has auto sorting.

Here's an example.
http://demo.displaytag.org/displaytag-examples-1.1/example-sorting.jsp

Problem is, if you click on columns to sort, that is considered an whole web page hit and makes using the back button difficult.  Everytime you sort, you have hit the Back button that many times to get to your original page.  I need the Back button to work because the pages are cached and faster to access.

I tried to use the following javascript to see if I can figure out a way to go back n number of times (n = number of times clicked on columns)
<INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);">

Figuring out the number in the go method is difficult and I just couldn't get it to work.

Any ideas how to get Displaytag to work with Back button after sorting?  Anybody experienced this same problem?
0
Comment
Question by:lcor
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 38854041
That page says
When doing sorts, we copy the list into our own internally managed list, so that we don't change the ordering of the original list.
Please check the API if any method is available to get values in original order.

Page also suggests
You can also define the column to be sorted by default (if the user has not yet clicked on any sortable column) specifying the column index in the defaultsort attribute of the table tag. The default order can be set using the defaultorder attribute: the default value is ascending, you can set it to descending to reverse the order.
That can be an alternate, you can display the initial list by sorting any of the column.
0
 

Author Comment

by:lcor
ID: 38861888
What does this have to do with the back button issue?
0
 

Author Closing Comment

by:lcor
ID: 39025839
Although did not answer question, am rewarding points for being the only one to try and answer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now