Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to auto-render a GUI using Ajax

 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to Everybody:

I have a selectOneMenu. If the user select one specific value relating to age of a person, I need to validate if this selection is valid based on code in the Backing bean. I am using Ajax and I donĀ“t undestand why when the selection is not valid the selectOneMenu is not rendering.

The XHTML code:


On the backing bean:
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be using JSF's validation feature. You can write a custom validator that uses the selectOneMenu and whatever other values it gets compared to, and puts the result in the validation queue.
 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guy deLyonesse for your help.

That's a better idea... Now I have a custom validation. Anyway I would like to use Ajax for instant validation ( I mean no waiting until the entire form will be submitted). How can I do it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic