• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I'm full of tinier men! And a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic