• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

prevent a page from loading

 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't get why you are ruling out history ?
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic