aspose file tools*
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
Author

rendered causing setter method of backend bean not invoking

kish kumar
Ranch Hand

Joined: Jan 03, 2008
Posts: 54
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

Joined: Jun 25, 2001
Posts: 16250
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: rendered causing setter method of backend bean not invoking