1 Reply Latest reply on Jan 6, 2013 9:28 AM by healeyb

    update css style on a4j:commandButton event

    flavioeasy

      Hi all,

       

      I'd like to mark fields in error, changing css style,  when the backing bean raises an error condition.

       

      To do this, in my code,  the style on input fields is driven by the backing bean in this way :

       

       

      <h:inputText id="u1usr" value="#{eSUser.ESUser.u1usr}" size="25"
                                           required="true" requiredMessage="#{mess.errUserUser}" maxlength="25" style="#{eSUser.getStyle('1')}"/>
      

       

      The input field is inserted in a rich:popupPanel that I submit with

       

       

      <a4j:commandButton action="#{eSUser.confirmData}" execute="ESUserEditPanel" image="/resources/images/check.png"
                                                 render="ESUserTable" value="" title="#{mess.tipConferma}" 
                                                 oncomplete="if (!ajaxRequestContainsErrors()) #{rich:component('ESUserEditPanel')}.hide(); " />
      

       

      My problem is that when the error is raised the rich:popupPanel is not rerendered and thus getStyle method is not called.

       

      I need something to force the rich:popupPanel reredered when an error occurs, but I don't know how yo do it.

       

      Any hint would be appreciated.

       

      Flavio