Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

f:ajax to update h:selectOneMenu

 
Carlos Jorge Tavares Ferreira
Greenhorn
Posts: 17
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to use an ajax event to update the values of a selectOneMenu.

With some workaround I was able to update the values (where can I see a good example on how to do this?),
but when I submit the form I'm getting a validation error on the component (javax.faces.component.UISelectOne.INVALID).

I'm doing this the wrong way, no doubt about it, it shouldn't be so complex:









What can I do to improve the code?

Kind regards,

Carlos Ferreira
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17622
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's required that whatever value you have in the target value of a Select control must be in the SelectItems collection. If you change the SelectItems and the old selected value isn't in the new SelectItems, you need to reset the selected value to blank, null, or an appropriate pre-selection (that is, something that's in the new SelectItems list).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic