File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes how jsf component get the value from backing bean instead of submitted value after validation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how jsf component get the value from backing bean instead of submitted value after validation error" Watch "how jsf component get the value from backing bean instead of submitted value after validation error" New topic
Author

how jsf component get the value from backing bean instead of submitted value after validation error

natarajan ap
Greenhorn

Joined: Jul 27, 2010
Posts: 3
My scenario is if i change country drop down box, state drop down box have to list states according to country selection. i did this using rich:combobox with a4j support.
Now when my jsf form is submitted , validation error occurs .
After that if i change country ,but the state drop down box is showing old submitted value .
how can i make my jsf component to get the value from backing bean instead of submitted value after validation error .
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

Welcome to the JavaRanch, Natarajan!

When you cascade controls like that, you have to do several things. One of them is to provide a valueChangeListener for the parent control. The a4jRequest should be "immediate", "ajaxSingle", and should reRender the child control.

In the valueChangeListener in the backing bean, you need to do 2 things. One is to setup the new child selection list so that its property accessor method can retrieve it. The other is to invalidate the current child selection value. You will have problems if the selection value is a value that's not in the new selection list.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how jsf component get the value from backing bean instead of submitted value after validation error