File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes rendered causing setter method of backend bean not invoking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "rendered causing setter method of backend bean not invoking" Watch "rendered causing setter method of backend bean not invoking" New topic

rendered causing setter method of backend bean not invoking

kish kumar
Ranch Hand

Joined: Jan 03, 2008
Posts: 54
I have a check box which will be rendered based on the value of selected drop down value from a drop down 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

Joined: Jun 25, 2001
Posts: 17410

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: rendered causing setter method of backend bean not invoking
It's not a secret anymore!