In my JSF application I am trying to put some conditions in my Command button update attribute so that on validation failure/Success I can control the components to update.
With reference to PrimeFaces: conditional update on validation I tried to to use
<p:commandLink process="@form" listener="#{foo}"
update="somethingElse" oncomplete="if (!args.validationFailed) $("#link").click();">
<p:commandLink style="display:none" id="link"
update="something">
But I don't know why this approach is not working for me.. click event of that particular component is not working for me.. I tried to execute the accepted answer for the same question , but I could not understand how that solve the purpose...
My purpose is to update conditionally depending on the result of the validation success or failure... Support I have 3 components X Y Z.. I am trying to do something like this..
<p:commandLink process="@form" listener="#{foo}"
update="if(Validation fail)updateSomething[e.g X and Y] **else** update somethingelse[e.g X Y and Z]">
To be more precise if the validations fails then I want to update X and Y component only if validations succeed than I want to update X Y & Z components..
Kindly help me out.. Thanks in advance.