We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Validate modification in ajax on a h:selectOneListbox

Nargzul
Nargzul asked
on
Medium Priority
395 Views
Last Modified: 2013-11-24
Hi!

I need to do the same thing that the related question, this time this is on a html event, so I don't know exactly how to manage this with the a4j:support?

OR

Is there an other component in richfaces that have the same display and have listener? or permit to have an direct synchronisation with the bean?
Comment
Watch Question

Kevin CrossChief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
Check the ajaxValidator, should work.  This page gives example of how to code the ValidationBean and include the tag in JSF.

http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxValidator.jsf?c=ajaxValidator&tab=usage

Author

Commented:
But I've nothing to validate on this field.

In facts, at the final validation, he could be empty, it's just an intermediary container
Kevin CrossChief Technology Officer
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
Oh, sorry guess I misunderstood.  Thought you were looking to do validation.

I am not sure, so will have to do some research.  I know there is a4j:ajaxListener, but I have not used enough to know for certain that is what you need; however, you can give it a try.  It is guaranteed to be invoked for every AJAX response before the Render Response fires.

Author

Commented:
I've try this but it doesn't work.

I've found this:
http://www.jroller.com/a4j/entry/ajax_updates_inside_jsf_complex1
But I've an error because the "selectOneListbox"  "Parent component treetake for a ajaxListener is not source of AjaxEvents"


<a4j:outputPanel id="ajxpn1" ajaxRendered="true">     
   <h:selectOneListbox id="listservtake"  rendered="#{AddDeal.serv!=null}" value="#{AddDeal.currentService}" >
      <f:selectItems  value="#{AddDeal.serv}"/>
   </h:selectOneListbox>
</a4j:outputPanel>

Open in new window

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.