4 Replies Latest reply on Mar 3, 2011 10:12 AM by v_panasyuk

    Can I make popupPanel not rendered in loaded page?

    v_panasyuk

      Can I make popupPanel or content popupPage not rendered in loaded page? And load using Ajax after I click command button with rich:componentControl. Because I can have a lot pop-up window with table, and I don't want to load all content(with executing a lot of query to db.)

        • 1. Can I make popupPanel not rendered in loaded page?
          ilya_shaikovsky

          you could do it for sure. just use something like:

           

          <a4j:outputPanel id="updateMeWhenNeedPanel">

               <rich:popupPanel rendered="#{shouldBeFalseUntilNeeded}" show="#{setToTrueIfNeedToDisplayRightAfterAction}">

                    ...

               </rich:popupPanel>

          </a4j:outputPanel>

           

          <a4j:commandButton action="#{controller.activatePanel}" render="updateMeWhenNeedPanel">

          • 2. Re: Can I make popupPanel not rendered in loaded page?
            v_panasyuk

            I try something like this. In IE 7.0 I have problem, when I execute  <a4j:commandButton>. I have JAVAScript ERROR

             

            with popup widow

             

            A runtime Error has occured. Do you wish Debug? Line 282. Error:'undefined' is null or not an object.

             

             

            <h:form prependId="false">

                                <a4j:commandButton action="#{patientDataModel.show}" value="Select patient"

                                                   render="selectPatientPopupWrapper" />

             

                                <a4j:outputPanel id="selectPatientPopupWrapper">

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

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

                                                     rendered="#{patientDataModel.rendered}"

                                                     show="#{patientDataModel.show}">

                                        <f:facet name="header">

                                            <h:outputText value="New accession" />

                                        </f:facet>

                                        <f:facet name="controls">

                                            <h:outputLink value="#"

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

                                                X

                                            </h:outputLink>

                                        </f:facet>

             

                                    </rich:popupPanel>

                                </a4j:outputPanel>

                            </h:form>

            • 3. Re: Can I make popupPanel not rendered in loaded page?
              ilya_shaikovsky

              has no error with next simple test.

               

              <h:selectBooleanCheckbox id="cb">

                                  <a4j:ajax render="mc @this"/>

                        </h:selectBooleanCheckbox>

                        </h:form>

                        <a4j:outputPanel ajaxRendered="true" layout="block" id="mc">

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

                                            rendered="#{rich:findComponent('cb').value}"

                                            show="#{rich:findComponent('cb').value}" resizeable="false">

               

              try to add layout to outputpanel

              • 4. Can I make popupPanel not rendered in loaded page?
                v_panasyuk

                I create simple page, but error still happend in IE 7.0.5730.13

                Mojarra 2.0.4 (FCS b09)

                 

                <?xml version='1.0' encoding='UTF-8' ?>

                <!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:f="http://java.sun.com/jsf/core"

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

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

                    <h:head>

                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

                    </h:head>

                    <h:body>

                        <h:form>

                            <h:selectBooleanCheckbox id="cb">

                                <a4j:ajax render="mc @this"/>

                            </h:selectBooleanCheckbox>

                      

                        <a4j:outputPanel ajaxRendered="true" layout="block" id="mc">

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

                                             rendered="#{rich:findComponent('cb').value}"

                                             show="#{rich:findComponent('cb').value}" resizeable="false"/>

                        </a4j:outputPanel>

                        </h:form>

                     </h:body>

                </html>