Solved

JSTL DisplayTag Back Button Issue

Posted on 2013-01-31
3
796 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mobile page Scrolling down when refreshing 4 30
jqury 17 30
CSS: How do I override in-line styling 11 15
How to reload page and grab querystring 2 6
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 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