Solved

JSTL DisplayTag Back Button Issue

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

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
Comment Utility
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
Comment Utility
What does this have to do with the back button issue?
0
 

Author Closing Comment

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

772 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

10 Experts available now in Live!

Get 1:1 Help Now