0 Replies Latest reply on Jun 4, 2008 5:01 PM by Bugs Bunny

    Handle ModalPanel using ComboBox

    Bugs Bunny Newbie

      Hi Guys,

      I have multiple modalPanel in my JSP. I want to call modalPanel depending on the current value in comboBox.

      Idea is when the user click the button I want to open the modalPanel depending on the current value in the combo box and also the title of the modalPanel should be the value of combo box which is populating from a backing bean.

      Value in backingbean.suggestionList are "suggestion 1" and "suggestion 2"

      <h:form>
       <rich:comboBox id="cb" value="#{backingbean.suggestion}">
       <f:selectItems value="#{backingbean.suggestionList}" />
       </rich:comboBox>
       <a4j:commandButton value="Richfaces.showModalPanel('#{backingbean.suggestion}',{width:500, top:200});" reRender="cb" />
      
       <rich:modalPanel id="suggestion 1" minHeight="200" minWidth="450"
       height="200" width="500" zindex="2000">
       <f:facet name="header">
       <h:outputText value="#{backingbean.suggestion} Title" />
       </f:facet>
       <a href="javascript:Richfaces.hideModalPanel('suggestion 1')">hide this panel</a>:
       Richfaces.hideModalPanel('suggestion 1')</p>
       </rich:modalPanel>
      
       <rich:modalPanel id="suggestion 2" minHeight="200" minWidth="450"
       height="200" width="500" zindex="2000">
       <f:facet name="header">
       <h:outputText value="#{backingbean.suggestion} Title" />
       </f:facet>
       <a href="javascript:Richfaces.hideModalPanel('suggestion 2')">hide this panel</a>:
       Richfaces.hideModalPanel('suggestion 2')</p>
       </rich:modalPanel>
      
      </h:form>


      Thanks in advance.
      BB