2 Replies Latest reply on Feb 26, 2014 2:22 AM by Mohammad Weshah

    rest rich:popupPanel data after client side validation (bug)

    Mohammad Weshah Novice

      Dear Professionals,

      I have main screen which include a table and Add button , every record on the table have an edit button ,  when i pressed the Add button the the rich:popuppanel open.

       

      my problem is if the client side validation fails on the richpopup and i closed the popup then reopen it the old data still exist , but if i closed the popup without any validation error the popup open without ant old values (correct).

       

      Add button in the main screen :

       

      <a4j:commandButton  id="addRoleBtn"

         value="#{lbs.BTN_ADD}"

         execute="@this"

         render="addRoleForm"

         actionListener="#{roleBacking.initAddAction()}"

         oncomplete="#{rich:component('addPopupRole')}.show();">

          <f:setPropertyActionListener value="false" target="#{roleBacking.closeAddDialog}" />

         </a4j:commandButton>

       

      the popup in separated screen and form :

      <rich:popupPanel   id="addPopupRole"

                         domElementAttachment="body"

                         modal="true"

                         header="#{lbs.ROLE_ADD_FN}"

                         moveable="true"

                         autosized="true"

                         headerClass="pop-header" >

                  

              <f:facet name="controls">

                  <h:outputLink value="#" onclick="#{rich:component('addPopupRole')}.hide(); return false;">

                      X

                  </h:outputLink>

              </f:facet>

         

      <h:form id="addRoleForm">

       

      It seem it is a bug , what is the work around ?

        • 1. Re: rest rich:popupPanel data after client side validation (bug)
          Siva P Master

          Add like below,

           

          Use a4j:command Button and oncomplete hide the popup

           

          <rich:popupPanel   id="addPopupRole"

                             domElementAttachment="body"

                             modal="true"

                             header="#{lbs.ROLE_ADD_FN}"

                             moveable="true"

                             autosized="true"

                             headerClass="pop-header" >

                      

                  <f:facet name="controls">

                      <h:outputLink value="#" onclick="#{rich:component('addPopupRole')}.hide(); return false;">

                     <a4j:commandLink value="#" action="{Do your server side action for clear values}" oncomplete="#{rich:component('addPopupRole')}.hide(); return false;"/>

                          X

                      </h:outputLink>

                  </f:facet>

             

          <h:form id="addRoleForm">

          • 2. Re: rest rich:popupPanel data after client side validation (bug)
            Mohammad Weshah Novice

            Hello Siva,

            I exactly what you said :

             

            <rich:popupPanel   id="addPopupRole"

                               domElementAttachment="body"

                               modal="true"

                               header="#{lbs.ROLE_ADD_FN}"

                               moveable="true"

                               autosized="true"

                               headerClass="pop-header" >

                       

                    <f:facet name="controls">

                        <h:outputLink value="#" onclick="#{rich:component('addPopupRole')}.hide(); return false;">

                       <a4j:commandLink value="#" action="{addBacking.init}" oncomplete="#{rich:component('addPopupRole')}.hide(); return false;"/>

                            X

                        </h:outputLink>

                    </f:facet>

             

            But unfortunately it dose not solve the problem.