Thanks for the help, - Dave
Rajneesh K Rajput
Joined: Nov 14, 2009
Yes, it is expected that "Value is not a valid option" will be shown because you have changed the value options using Java Script, and when page gets submitted JSF restore the view and this new selected value might not be matching with any of the previous options.
So, what you need to do is you need to change mechanism (where values are dependent, textbox value), which is responsible to update the values at server side not only client side just by using Java Script, so that in restore phase it always aware of with the last entered value in the text field.
1) Please check- t:saveState and try binding text field value with t:saveState and make sure that while generating values for dropdown it picks text filed value from binding variable.
2) Use some in-build Ajax framework, like RichFaces very powerful for JSF to implement such features using ajaxSubmit tag.
Joined: Jul 02, 2008
Rajneesh, Thanks for the reply but I'm not understanding what you are explaining. How do I use t:saveState to re-populate the selectOneMenu when the value of my h:inputText field changes? Any more detail you can provide is greatly appreciated, - Dave