6 Replies Latest reply on Nov 4, 2008 6:23 AM by janson12

    auto height on modalPanel

      Hi!
      Is there a way to let the content of a modal panel define its height? as i'm displaying different messages the height can vary and i don't want to set the maximum height per default.
      thanks -j

        • 1. Re: auto height on modalPanel
          nbelaevski

          Hi,

          Set autosized="true"

          • 2. Re: auto height on modalPanel

            If I set autosize="true" the panel gets way to high (according to firebug its 300x200 which would mean standart size). i already checked for self-defined styles regarding the content in the panel however couldn't find anything....

            • 3. Re: auto height on modalPanel
              nbelaevski

              What about the following code:

              <h:form>
               <h:commandLink value="Show" onclick="#{rich:component('mp')}.show(); return false;" />
               </h:form>
              
               <rich:modalPanel autosized="true" id="mp"><h:outputText value="text" /></rich:modalPanel>
              ?

              Also try to set minWidth/minHeight

              • 4. Re: auto height on modalPanel

                thanks for your response. i tried the min-attributes however the modalpanel still renders a table that seems to stretch it:

                <rich:modalPanel id="deletePersonMP"
                 moveable="false" resizeable="false" autosized="true" minWidth="300" minHeight="130">
                 <f:facet name="header">
                 <h:panelGroup style="text-align:left">
                 <h:outputText value="#{msg_org.personDelete_titel}"></h:outputText>
                 </h:panelGroup>
                 </f:facet>
                 <h:outputText id="mp_delete_text"
                 value="#{PersonBean.deleteConfirmQuestion}" />
                
                 <h:form>
                 <rich:spacer height="30" />
                 <h:panelGrid columns="3" style="width: 100%" border="0"
                 columnClasses="modalDelete">
                 <a4j:commandButton id="yes" type="submit" value="#{msg.yes}"
                 action="#{PersonBean.delete}" actionListener="#{PersonBean.resetPersonBean}"
                 styleClass="commitButtons" reRender="ajaxArea"
                 eventsQueue="ViewQueue" ignoreDupResponses="true"
                 onclick="Richfaces.hideModalPanel('deletePersonMP')">
                 </a4j:commandButton>
                 <h:outputText value="" />
                 <a4j:commandButton id="no" type="submit" value="#{msg.no}"
                 onclick="Richfaces.hideModalPanel('deletePersonMP')"
                 styleClass="commitButtons" style="align:center">
                 </a4j:commandButton>
                 </h:panelGrid>
                 </h:form>
                </rich:modalPanel>


                renders:

                <table id="j_id_jsp_1762201694_20:deletePersonMPContentTable" cellspacing="0" cellpadding="0" border="0" style="width: 300px; height: 200px;">


                If i remove the width and height argument in the browser (using firebug), the modalpanel collapses to the right size (fitting to the content).

                • 5. Re: auto height on modalPanel
                  nbelaevski

                  Does that reproduce in 3.2.2? I've fixed the issue for 3.2.2, so older versions can have this bug... Try to set width/height to some small value - that can help.

                  • 6. Re: auto height on modalPanel

                    in fact we're still using 3.2.1 due to some layout distortions we had with 3.2.2.
                    (i think the suggestion boxes appeared at random locations)
                    if i indicate a smaller height, let's say 80, the panel hides the overflow. gonna set some static size now. thanks anyway