Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

prevent a page from loading

 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1274
10
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get why you are ruling out history ?
 
John Pradeep.v
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic