2 Replies Latest reply on Jun 13, 2007 11:16 AM by dougthug

    rich:ModalPanel loosing its facets

    dougthug

      My original problem was I couldn't get a commandButton working from within a modalPanel. I got past that by putting the form inside of the modalPanel, but my facets don't render if I do that.

      So this fails to call the action but I have my facets:

      <t:div>
       <h:form>
       <rich:modalPanel>
       <f:facet name="header">
       <h:outputText value="Test" />
       </f:facet>
       <f:facet name="controls">
       <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
       </f:facet>
       <t:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
       </rich:modalPanel>
       </h:form>
      </t:div>
      


      and this calls the action, but fails to render my facets:
      <t:div>
       <rich:modalPanel>
       <h:form>
       <f:facet name="header">
       <h:outputText value="Test" />
       </f:facet>
       <f:facet name="controls">
       <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
       </f:facet>
      
       <t:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
       </h:form>
       </rich:modalPanel>
      </t:div>
      


      Please advise, and thanks in advance.

        • 1. Re: rich:ModalPanel loosing its facets

          <h:form> must be inside <rich:modalPanel>.

          <f:facet> components must be children of <rich:modalPanel>.

          <rich:modalPanel>
          <f:facet name="header">
          <h:outputText value="Test" />
          </f:facet>
          <f:facet name="controls">
          <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
          </f:facet>

          <h:form>
          <t:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
          </h:form>

          </rich:modalPanel>

          • 2. Re: rich:ModalPanel loosing its facets
            dougthug

            Well it throws an IllegalArgumentException for having the "Close" link outside of a form, but if I remove the commandLink from the facet and put it next to the "Test" commandButton, they both work and the facet is rendered, so I can live with that. Thanks for the quick reply.