5 Replies Latest reply on Jun 22, 2011 5:41 AM by sarocks

    how to use multipal rich:popuppanel on one xhtml page

    sanjadhav21

      how to use multipal rich:popuppanel on one xhtml page

        • 1. Re: how to use multipal rich:popuppanel on one xhtml page
          sarocks
          1 of 1 people found this helpful
          • 2. Re: how to use multipal rich:popuppanel on one xhtml page
            sanjadhav21

            In rich:popup panel i am using ui:include to get a xhtml popup

            so i have to ask , suppose i have 10 popups so i have to use the ui:include for every popup or is there any other way..?

            • 3. Re: how to use multipal rich:popuppanel on one xhtml page
              sarocks

              If I got your question correctly, you have 10 popups but at a time you want to display only one popup!

              Then in one xhtml file only you can define number of popups with different ids..

               

              Can you post your code here, and write what you need to do!

              • 4. Re: how to use multipal rich:popuppanel on one xhtml page
                sanjadhav21

                I have a main page (main.xhtml) , which contains 10 ui:inclues (page1.xhtml ..to.. page10.xhtml).

                 

                In my main.xhtml page i have 10 button, on click on these button  i need to execute some action and ooncomplete need to open corresponding pages as a popup window.

                 

                Which is the best way to do this.

                 

                 

                Here is my code snippet

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

                    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:form>

                ....

                <a4j:commandButton action="#{main.action1}" oncomplete="#{rich:component('pop1')}.show()"> </a4j:commandButton>

                .

                .

                <a4j:commandButton action="#{main.action10}" oncomplete="#{rich:component('pop10')}.show()"> </a4j:commandButton>

                ....

                </h:form>

                 

                <rich:popupPanel id="pop1" resizeable="true" modal="true"    

                        minHeight="305" minWidth="340" height="305" width="340" zIndex="2000">

                        <f:facet name="header" >

                            <h:outputText value="Head1" />

                        </f:facet>

                        <f:facet name="controls">

                            <h:outputLink value="#"

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

                                title="Close">

                                <h:graphicImage value="../images/close.jpg" alt="X"

                                    style="cursor:pointer" />

                            </h:outputLink>

                        </f:facet>

                 

                        <ui:include src="page1.xhtml" />

                </rich:popupPanel>

                 

                 

                <rich:popupPanel id="pop2" resizeable="true" modal="true"    

                        minHeight="305" minWidth="340" height="305" width="340" zIndex="2000">

                        <f:facet name="header" >

                            <h:outputText value="Head1" />

                        </f:facet>

                        <f:facet name="controls">

                            <h:outputLink value="#"

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

                                title="Close">

                                <h:graphicImage value="../images/close.jpg" alt="X"

                                    style="cursor:pointer" />

                            </h:outputLink>

                        </f:facet>

                 

                        <ui:include src="page2.xhtml" />

                </rich:popupPanel>

                 

                ............

                ...........

                ...........

                <rich:popupPanel id="pop10" resizeable="true" modal="true"    

                        minHeight="305" minWidth="340" height="305" width="340" zIndex="2000">

                        <f:facet name="header" >

                            <h:outputText value="Head1" />

                        </f:facet>

                        <f:facet name="controls">

                            <h:outputLink value="#"

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

                                title="Close">

                                <h:graphicImage value="../images/close.jpg" alt="X"

                                    style="cursor:pointer" />

                            </h:outputLink>

                        </f:facet>

                 

                        <ui:include src="page10.xhtml" />

                </rich:popupPanel>

                • 5. Re: how to use multipal rich:popuppanel on one xhtml page
                  sarocks

                  using ui:include is good I think! it makes page smaller and simpler.

                  You can implement as you wish, as long as it works!