• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rendered causing setter method of backend bean not invoking

 
kish kumar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a check box which will be rendered based on the value of selected drop down value from a drop down list.now on selecting the check box another panel with 3 fields should be rendered. But the setter method corresonding to the property <h:selectBooleanCheckbox id="checkBox" value="#{backendbBean.includeLine}"> for check box that is setIncludeLine(boolean val) is not getting invoked. How to solve this problem ? Please share valuable solution
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are hoping that simply making a dropdown selection will update the page, you are hoping in vain. JSF is built on HTTP and HTTP only contacts the server when a SUBMIT operation is done. And the server will then process the form and update the displayed page.

SUBMIT can be done in 1 of 3 ways:

1. User clicking on a JSF commandButton
2. User clicking on a JSF commandLink
3. AJAX request.

To update the display when a dropdown selection is made without requiring the user to click on something, you have to use option #3. To do AJAX in JSF, you either need to employ one of the AJAX-supporting extension tagsets such as RichFaces or IceFaces, or you have to be using JSF2, which added an ajax capability to the core JSF.

When the AJAX event fires, it can do a partial SUBMIT, so that only selected controls from the form are submitted to the server. Likewise, you can direct a partial page update, which will redraw limited areas of the displayed page instead of updating the entire display.

In any event, whether you use option 1, 2, or 3, the submitted data must all be valid. JSF validates form data before it does anything else, so one or more invalid inputs will short-circuit the process that otherwise would update the backing bean and invoke the submit action method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic