Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
  • 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: 22289
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
    Bookmark Topic Watch Topic
  • New Topic