This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

JSF Edit Page  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to pass an account object from one page to another page in my JSF application. I have a list page that displays a list of accounts in a data table. This page is backed by a bean. Each row of the data table has an edit button, that when clicked, will bring the user to an edit page and pass the currently selected account. The edit page is backed by a separate bean.

The bean includes a property that represents the account to edit and the account's properties are referenced in the jsp using the value attribute, i.e.


My question is how do I get the selected object from the list page into the bean that backs my edit page? What I really need to do is load the object from the list page into my bean and then set it equal to the account property so that when JSF renders the view, it grabs the values from that object. I tried doing this in the constructor and it didn't work. Is there any sort of way to interrupt JSF and load the object from the list before rendering the page but after construction?

If that doesn't work, I was going to bind each of the fields on the page to my bean and set the values myself in the constructor. Is this how it always has to be done? It seems like there must be a better way.

Thanks for your help!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read something about f:propertyActionListener tag. I always use it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!