Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
natarajan ap
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic