• 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

Reset session scoped backing bean values

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

how can i set the backing bean values(properties) to null in java scipt.

My case is:

ented to and from dates in a screen , which maps the entered values to backing bean. if it successfully gets the records from the databse i can continue to the next screen and if not come back same screen with values. This part is done. but if i goto any part of the other website by clicking the links provided in the page ...it should nullify the entered values and leave the page.(just setting the form field values to null doen't work here, since the fiedls are mapped to backing bean properties, so we need to change them). Can we do this java script? or any other way?

Thanks
Ven
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is one way of doing this:

lets call your screen that has the "to" and "from" dates as "blah.faces"

set up a filter / viewhandler that does this :-

1. get the requested url
2. if the requested url is not "blah.faces" and then remove the backing bean from the session attributes.


[ November 12, 2007: Message edited by: Richard Green ]
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Richard,

Thanks for your reply. I would be able to solve the issue with your idea.

Thanks
Ven
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have an example of the code to do this?

Phil
 
We don't have time for this. We've gotta save the moon! Or check this out:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic