Remove ui-state-error primefaces on ajax render

Posted: May 25, 2012 in web

the class ui-state-error still exist after validating form element then switching from one pane to another with ajax

solution (use p:ajax):

<p:selectOneRadio value="#{test.panel1}">
 <f:selectItem itemLabel="Account"
 itemValue="BAccount" />
 <f:selectItem itemLabel="Credit"
 itemValue="BCredit" />
 <p:ajax oncomplete="$('.ui-state-error').removeClass('ui-state-error');" update="payment-recurring-form"/>

oncomplete fires after the partial view is rendered.

  1. […] new (useful) recipe, adapted from Remove ui-state-error primefaces on ajax render has been published. Thank you to the author that published on his/her blog this nice […]

  2. pzenida says:

    Cool tip 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s