aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes  prevent a page from loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark " prevent a page from loading" Watch " prevent a page from loading" New topic
Author

prevent a page from loading

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I have a JSP with a table consisting of few rows.The user should select a row and click on "NEXT" button to go to next jsp.In the 2nd jsp there is a "BACK" button which takes you to previous jsp.The issue is that on click of "BACK" the user should see the 1st jsp as it was before the control came to 2nd jsp,meaning if the user selected row 5 and goed to 2nd jsp,on Back ,the user should be able to view jsp1 with the row 5 as selected.what should be done here on back?

I wrote a function for selection of the row.

1)history is ruled out as I have many jsp's each having a back button
2)Ajax loads everything again onback but is it good to manage selected row like this?

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well if I were you, I would not remove the content from the page, I would just hide it. So when the person hits the back button it just shows the content that is already there. This eliminates unnecessary calls to the server.

Eric

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I would not remove the content from the page, I would just hide it


I didn't get this Eric... I mean how and where would you hide it and how on back would the same page be displayed...Kindly elaborate.
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 917

I didn't get why you are ruling out history ?


My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
John Pradeep.v
Ranch Hand

Joined: Jul 21, 2008
Posts: 59
Pradeep Adibatla wrote:I have a JSP with a table consisting of few rows.The user should select a row and click on "NEXT" button to go to next jsp.In the 2nd jsp there is a "BACK" button which takes you to previous jsp.The issue is that on click of "BACK" the user should see the 1st jsp as it was before the control came to 2nd jsp,meaning if the user selected row 5 and goed to 2nd jsp,on Back ,the user should be able to view jsp1 with the row 5 as selected.what should be done here on back?

I wrote a function for selection of the row.

1)history is ruled out as I have many jsp's each having a back button
2)Ajax loads everything again onback but is it good to manage selected row like this?



As eric said, just try to not make a server call by hiding/showing content on a single page... another alternative would be to put the selected row in session and use it to enable/disable the row as the JSP renders.

John
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Well if I were you, I would not remove the content from the page, I would just hide it. So when the person hits the back button it just shows the content that is already there.


hide it, meaning? hidden tag? or history.go(-1)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prevent a page from loading
 
Similar Threads
passing JS values in struts-2
setting values for table cells in javascript
setting values in jsp+struts2
setting a row value
a JS value passing issue