• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

confirmation message  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tiles framework in use....there is a sidebar with a link to display the content page.on clicking the link,a welcome pg is displayed which has button.on clicking it a save page is diplayed with a number of fields to save on database.now,the problem:
if the user clicks the hyperlink on the sidebar(which always displays ther welcome page) before sumbitting the save button a javascript confirmation box appears("do u want to save?yes/no").if yes,then cursor comes back to the save page,else the welcome page is displayed.
constraint:This should happen only when content page is the save page
I hope u have understood the scenario.
My attempt:
attach onchange with each field which calls a javascript method,wherein i set some flag.In the jsp of the sidebar,i check for this flg,if set then throw a confimbox else quitely move to the welcome page.
How to set the flag in the save page which is visisble to the sidebar jsp .......in some attribute value??
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possible solution would be to have each JSP that loads in the main page tile set a javaScript global variable. For example, in the save page, you could have:

var g_mainPage = "savePage";

Other pages would set g_mainPage to other values. Then in your links, you could check the value of g_mainPage to determine which page is being displayed.
 
biswajit goswami
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the use of global script variable has resolved the issue...............thanx
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!