• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Backing bean does not get updated data

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have radio buttons (labeled Yes / No) on my page that control the display of a panelFormLayout( that contains a list of <tr.inputText> and SelectOneChoice fields).
Here is the scenario where i am facing the problem:
- User visits the page with the radio button value is 'No'(read from DB) and the page wont display the PanelFormLayout with the fields.
- User selects 'Yes' radio button, this triggers a page 'submit' that calls a method inside the backing bean to set the 'rendered' attribute of the panelformLayout to 'true'. The panelFormLayout now gets displayed and the fields are visible.
- User enters new values into the form fields inside the PanelFormLayout and clicks 'save' button that calls 'Save' method inside the backing bean.

Problem: The values user entered in the fields inside the PanelFormLayout are not picked up. The backing bean still sees only the default(initial) values.

This does not occur when the radio button value is 'Yes'. This means when user visits the page, the PanelFormLayout and its fields are rendered right away. IF user changes the values inside PanelFormLayout, and clicks on save, the 'save' method inside the backing bean sees those updated values.

It appears that only when the fields are displayed by default JSF picks up the updated field values, but if we display the fields conditionally or at a later point, JSF not pick up the updated field values.

Is my observation/assumption correct? If so what should be my course of action? Please suggest a solution for my problem.

Please excuse if my description is verbose. I only wanted to be clear about my problem.


Thanks for your time and help,
Srikanth.
 
reply
    Bookmark Topic Watch Topic
  • New Topic