0 Replies Latest reply on Aug 24, 2011 10:53 AM by michael.degols

    JSF 2.0 + component styling on validation error

    michael.degols

      Hi all,

       

      I'm trying to make that code working but without success. I'm using mojarra 2.0.6.

      <h:panelGroup styleClass="#{!foo.valid ? 'error' : 'none'}">
         
      <h:inputText id="foo" binding="#{foo}" />
         
      <h:message for="foo" />
      </h:panelGroup>

       

      The selected style class is always error.

       

      This code is working:

      <h:inputText id="foo" value="#{newMember.email}" styleClass="#{!component.valid ? 'invalid' : 'none'}"/>
      

       

      Any hints ? Any other solution ? Thanks!