Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reset session scoped backing bean values

 
Ven Red
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Richard Green
Ranch Hand
Posts: 536
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Venkata
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Richard,

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

Thanks
Ven
 
philip f williams
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have an example of the code to do this?

Phil
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic