Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pagination

Posted on 2003-10-30
8
Medium Priority
?
436 Views
Last Modified: 2008-03-10
Hi ,

Currently I am working on Struts.
I am working on a pagination code.
I have two hidden fields in my form namely 'next' and 'prev'.
I also have a <input type="image"> (for 'Next' and 'Prev'), on the click of which i set either of the two hidden fields to a value.
ON the server side, i check these values from request and take appropriate action.

The problem -
I click on the 'Next' image, and get appropriate action done. I get the expected output
page. Now if i press 'F5' or Refresh on the browser, on the server side the code written for
'Next' gets executed and instead of reloading the same page, it gives me the next expected page which is wrong. How do i stop this from happening ?

Thanks in advance...

Regards,
Janarthan S
0
Comment
Question by:janarthanasp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
8 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 2000 total points
ID: 9648497
I use this with my struts app:

http://jsptags.com/tags/navigation/pager/index.jsp

it's really cool :-)  (and saved me all this sort of grief :-( )

Tim
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9648525
> How do i stop this from happening ?

Have you tried setting the redirect property on the ActionMapping for prev and next to "true"?

0
 
LVL 2

Expert Comment

by:f_98
ID: 9649019
i'd include another "index" hidden field just to ensure that everytime it executes a "next" command, it
starts off from this current index(of a list i suppose). (it is supposed to resubmit when you hit f5 anyway) so at least
it will keep on showing the same page. just like in google or other sites where you can see a start=x form element when you hit next
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 9649027
> (it is supposed to resubmit when you hit f5 anyway)

But you can get around this, by having the FormAction redirecting to the ViewAction...

then, refresh will just refresh the view, not resubmit data
0
 

Author Comment

by:janarthanasp
ID: 9649712
Hi Tim,

Thank you very much for the prompt response.
I am having a try with http://jsptags.com/tags/navigation/pager/index.jsp link that you gave. It looked like worth a shot.

Thanks again !!!
Regards,
Janarthan S
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9649728
Hope it works for you :-)

It is really rather cool :-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

618 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