• 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

How to re-initialize bean from JSF??

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

I am using JSF in my web project.

I have a MyBean class, where I am initiazing the bean with some hardcoded values of some products.
In my webpage, I display these products and I have a "details" command button for each displayed product/

When I click on this,
I want to navigate to some details page.
For this, I want to catch the instance on which the button was clicked using "setPropertyActionListerner"

And in MyBean class, I just return the navigation.
In my webpage2, I can see the correct instance(which ever I clicked on)


Problem is:
The bean is session scoped.
When I am in webpage2…and I click 'back' and click on details button of some other product
Again I get the same instance.

Is there a way I can re-initialize my bean now??
i) I used this approach, but it doesn’t work

MyBean myBeanObject = new MyBean();
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("myNewBean", myBeanObject )

How do I re-initialize my bean now?

Thanks for the help.
Regards, Rashmi
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic