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"/>
 </p:selectOneRadio>

oncomplete fires after the partial view is rendered.

Advertisements
Comments
  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 🙂
    Thanks.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s