4 Replies Latest reply on Jun 1, 2011 6:33 PM by ilya_shaikovsky

    commandButton not working

    lessonz
      <rich:popupPanel id="errorPopup" modal="true" show="#{testBean.userMessageWaiting}">
          <a4j:outputPanel>
              <h:outputText class="centered" binding="#{testBean.errorMessage}" />
              <a4j:commandButton action="#{testBean.clearUserMessages}"
                  render="testGrid, actionButtons, testPanel, errorPopup"
                  value="OK" />
          </a4j:outputPanel>
      </rich:popupPanel>
      

       

      I have this popup inside of the html tags and outside of all other tags (in case scope is an issue). I also tried a JSF commandButton. The outputText is getting the errorMessage (a property) from the backing bean. The problem is when the button is clicked, the clearUserMessages() method in the same backing bean is never called. I have logging in the method, and that's not being output. Any help would be greatly appreciated. Thanks.

        • 1. Re: commandButton not working
          liuliu

          hi,

           

          do you have a validate error / convert error? put a rich:messages in your page.

          • 2. Re: commandButton not working
            lessonz

            I tried putting a rich:messages in the modal, and it doesn't spit out anything.

            • 3. Re: commandButton not working
              lessonz

              Okay, so I believe it's because the popupPanel wasn't inside of the form. I've since fixed that. The method is now called (I get my logging output), but in the method clearUserMessages, the boolean userMessageWaiting is set to false. This value doesn't seem to be updated. Aside from the show being set with this value, I also have an outputText rendering this value. I have set the button to render both the outputText and the popupPanel, and there appears to be no change to the variable.    

              • 4. Re: commandButton not working
                ilya_shaikovsky

                not sure why your new variable is not used on rendering.. probably need to check more complete code. But what could I say - the form should be inside popup by default. And not outside. There will be other issues with that. Or in order to use as you trying - read about domElementAttachment attribute and form limitation in reference.