2 Replies Latest reply on Dec 3, 2010 5:39 PM by cmathrusse

    difficulty conditionally showing a popupPanel

    cmathrusse

      I'm using RichFaces 4 M4 and I need to display a popupPanel (modal) conditionally when a user makes a specific selection. I have a dropdown list that the user must make a selection from and based upon the selection made a modal popupPanel should be displayed.

       

       

                          <h:outputLabel for="intensity-list" value="#{msgs['label.schedule']}" />      

                          <h:panelGrid id="intensity" columns="1">

                              <h:selectOneMenu id="intensity-list"

                                  enabledClass="intensity-list" layout="pageDirection"

                                  value="#{quote.programIntensity}" required="true"

                                  valueChangeListener="#{quote.processProgramIntensitySelectValueChange}">

       

                                  <f:selectItem itemLabel="--" itemValue="" />

                                  <f:selectItems value="#{intensityController.programIntensities}" />

                                  <a4j:ajax/>

       

                              </h:selectOneMenu>

                          </h:panelGrid>

       

      When the user makes a selection an ajax call is made to my backing bean using the value change listener. There I make the determination if the modal popupPanel should be displayed.

       

              <rich:popupPanel id="popup-panel" modal="true" autosized="true" render="#{quote.showPopupDialog}"

                  minHeight="150" minWidth="420" height="150" width="420" zindex="2000" resizeable="false">

                  <f:facet name="header">

                      <h:outputText value="#{msgs['popup-warning.title']}" />

                  </f:facet>

                  <f:facet name="controls">

                      <h:outputLink value="#" onclick="#{rich:component('popup-panel')}.hide(); return false;">X</h:outputLink>

                  </f:facet>

       

                  <h:form>

                      <h:panelGrid columns="2">

                          <h:graphicImage url="/images/warning_icon.gif"/>

                          <h:outputLabel value="#{msgs['popup-warning.message']}"/>

       

                          <h:outputText value="" />

                          <a4j:commandButton

                              oncomplete="#{rich:component('popup-panel')}.hide();return false"

                              value="#{msgs['button.ok']}" action="#{quote.acknowledgeRestrictions}" />

                      </h:panelGrid>

                  </h:form>

              </rich:popupPanel>

       

      My problem is that I can't seem to figure out how to get the popup to render after the ajax call. Can someone give me a few pointers to accomplish this please?

       

      Thanks very much for the help...