2 Replies Latest reply on Nov 12, 2012 6:43 AM by martam

    a4j:ajax and cancel button problem

    martam Newbie

      Hi,

       

      I have a problem with cancel button inside the edition popup. My popup looks like this:

       

      <rich:popupPanel header="EDITION" id="editionPopup" domElementAttachment="form" autosized="true">
           <h:panelGrid columns="2" id="editGrid">
                <h:outputText value="Name" />
                <h:inputTextarea value="#{editedElement.name}" rows="2" cols="50">
                     <a4j:ajax event="blur"/>
                </h:inputTextarea>
           </h:panelGrid>
      
           <a4j:commandButton value="Cancel" onclick="#{rich:component('editionPopup')}.hide(); return false;" />
      </rich:popupPanel>
      

       

      Everything worked fine but when I added  <a4j:ajax event="blur"/> (I need this to workaround a bug described here: https://issues.jboss.org/browse/RF-12301, I use rich:autocomplete and rich:calendar in my form, but I've skipped them for clearness).

      And now the cancel button doesn't work correct: when I edit something and then click cancel, the setter method is invoked, so when I open edition of this object once more, I see modificated values of fields.

       

      What should I change to get the cancel button working? Or maybe there's another workaround for https://issues.jboss.org/browse/RF-12301)?

       

      Marta