2 Replies Latest reply on Jun 2, 2013 11:41 PM by sivaprasad9394

    rich:popupPanel problem (listeners aren't called with the first click)

    ikos2201

      Hi, guys !

      I have the next problem with rich:popupPanel : any listener are not called with the first click on any component !

       

      I have a popupPanel (modal) and a separate page which I include as a content for this popupPanel.

      Content page looks like this :

       

      <h:form id="contentPage">

           // here I have radiobuttons, dropdowns, etc.

            // e.g.  

           <h:selectOneMenu id="editingModePurpose"

                value="#{debitCardClaimEditing.purposeId}"

                    styleClass="input-text1"

                     style="width: 200px;">

                      <f:selectItems value="#{debitCardClaimEditing.purposeList}"/>

                      <a4j:ajax event="valueChange"

                      listener="#{debitCardClaimEditing.purposeChangeListener()}" render="leftcol"

                      execute="@this" />

             </h:selectOneMenu>

       

      </h:form>

       

      When I try to change smth., select radiobutton or change value for dropdawn listener aren't called with the first click , but with the second and the next and next everything is OK.

      Then I close my popup, open again and have the same - first click doesn't work !

       

      I have searched the solution , but with no success, but I have found people with the similar problem (https://community.jboss.org/thread/167869)

       

      In output (I  mean html code) I have :

      <html>

      <head></head>

      <body>

      <div id="MyPopupId" ... > ... </div>

      // the rest code

      <h:form> ... </h:form>

       

      ...

       

       

      </doby>

      </html>

       

      Have you any ideas ???

       

      Popup Window :

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"

            xmlns:h="http://java.sun.com/jsf/html"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:f="http://java.sun.com/jsf/core"

            xmlns:a4j="http://richfaces.org/a4j"

            xmlns:c="http://java.sun.com/jsp/jstl/core">

       

       

      <ui:component>

          <rich:popupPanel id="popup" modal="true"

                           resizeable="true" width="1024" height="768"

                           onmaskclick="#{rich:component('popup')}.hide()">

              <f:facet name="header">

                  <h:outputText value=" Title " />

              </f:facet>

              <f:facet name="controls">

                  <h:form>

                      <h:commandLink value=""

                                     onclick="#{rich:component('popup')}.hide(); return false;">

                          <h:outputText value="Close" style="font-weight: bold;" />

                      </h:commandLink>

                  </h:form>

              </f:facet>

               <!--  CONTENT PAGE -->

              <ui:include

                      src="/content/pages/application/packageSelection/EditDebitCardClaim.xhtml" />

          </rich:popupPanel>

      </ui:component>

      </html>

       

      I HAVE FOUND VERY INTERESTING THING - I DON'T HAVE ViewState ID IN REQUEST WITH MY FIRST CLICK AND I DON'T KNOW WHY.

        • 2. Re: rich:popupPanel problem (listeners aren't called with the first click)
          sivaprasad9394

          Hi John,

           

          try like below

           

          For you event is not firing properly.

          <h:selectOneMenu id="StatusField" required="true" immediate="true"

                                           value="#{Bean.Status}"  valueChangeListener="#{InfoBean.optionSelectedComboBoxStatus}">   

                                           <f:selectItems value="#{listBoxBean.selectStatus}"/>                     

                      <a4j:support  event="onchange"

                                           limitToList="true" ajaxSingle="true" eventsQueue="fooQueue"

                                           reRender="panelenter,panelretail">   

                  </a4j:support>         

           

          And also you can make use of rich:combobox also ,

           

          <a4j:region id="paymentselRegion">

                   <h:panelGrid columns="8"  border="0">            

                           <rich:comboBox id="cbxnewpayField" requiredMessage="#{msg.requiredField}" immediate="true"

                                           listClass="myClass" selectFirstOnUpdate="false"    required="true"    enableManualInput="false"

                                          defaultLabel="#{msg.defaultLabel}" directInputSuggestions="true"

                                          value="#{editPaBean.cbxpmPayMethod}"

                                           valueChangeListener="#{editPaymentInfoBean.ajaxoptionCardChangeValueChangeListener}">          

                              <f:selectItems value="#{listBoxBean.selectPaMethod}"/>

                              <a4j:support event="onchange" limitToList="true" id="ajaxSuppPaymentMethodID"

                                  actionListener="#{editPayInfoBean.ajaxoptionCardChangeActionListener}"

                                  reRender="panelcreditcard">                       

                           </a4j:support>

                     </h:panelGrid>

                </a4j:region>

           

           

          Both the combobox you can use inside the Model panel.

           

          Thanks,

          Siva