-
1. Re: Call rich:Modal Panel from another page
ilya40umov Jan 5, 2011 7:35 AM (in response to mahi101987)Do you use facelets in your project?
If you do you can use ui:include. It should do the trick.
Otherwise you can try jsp:include.
-
2. Re: Call rich:Modal Panel from another page
mahi101987 Jan 5, 2011 8:37 AM (in response to ilya40umov)Yes we are using facelets
Could u provide some sample
Thanks
-
3. Re: Call rich:Modal Panel from another page
ilya40umov Jan 5, 2011 8:36 AM (in response to mahi101987)You can even create a custom component based on facelets and it shouldn't get much time.
Look at the following link for details:
-
4. Re: Call rich:Modal Panel from another page
mahi101987 Jan 6, 2011 8:42 AM (in response to ilya40umov)Can somebody show me how to do it ..
i have modal panel code in one page say page1.xhtml
now if i want to open this modal panel on click of a link in second page say page2.xhtml
in page 2.xhtml i am including this line
<ui:include src = page1.xhtml>
will that do
or should i need to add something more
Thanks
-
5. Re: Call rich:Modal Panel from another page
ilya40umov Jan 6, 2011 8:54 AM (in response to mahi101987)Yes, you should do the following steps:
1) Create page1.xhtml and it will look like this:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"; xmlns:ui="http://java.sun.com/jsf/facelets"; xmlns:f="http://java.sun.com/jsf/core"; xmlns:h="http://java.sun.com/jsf/html"; xmlns:rich="http://richfaces.org/rich"; xmlns:a4j="http://richfaces.org/a4j"> <rich:modalPanel id="myModalPanel"> <f:facet name="header"> <h:outputLabel value="123"/> </f:facet> <f:facet name="controls"> <h:graphicImage value="/img/icons/xtiny/close.png" styleClass="linkImage"/> </f:facet> <h:form id="modalPanelFormForm"> PLEASE PUT YOUR COMPONENTS HERE ! </h:form> </rich:modalPanel> </ui:composition>
2) use ui:include in page2.xthml
<ui:include src="/pages/myModalPanel.xhtml" />
-
6. Call rich:Modal Panel from another page
mahi101987 Jan 9, 2011 9:03 AM (in response to ilya40umov)When to try the code it the same way it is not working ?
Thanks
Mahendra -
7. Call rich:Modal Panel from another page
ilya40umov Jan 9, 2011 10:13 AM (in response to mahi101987)It seems that I can't understand you.
1) Does it mean that you already tried this and it didn't help you?
2) Could you describe your probelm with using of ui:include again?
3) Could you post a sample of your code?
-
8. Re: Call rich:Modal Panel from another page
mahi101987 Jan 9, 2011 11:37 AM (in response to ilya40umov) -
9. Re: Call rich:Modal Panel from another page
ilya40umov Jan 9, 2011 12:05 PM (in response to mahi101987)Excuse me, but I still can't see your code.
-
10. Call rich:Modal Panel from another page
mahi101987 Jan 9, 2011 12:07 PM (in response to ilya40umov)Please click on the images to see my code
Thanks
Mahi
-
11. Call rich:Modal Panel from another page
ilya40umov Jan 9, 2011 12:19 PM (in response to mahi101987)Seems I've understood your problem. You need to move <rich:modalPanel> to a xhtml file without any template. It should be just a xtml page with rich:modalPanel on it. And then include it to both pages by ui:include.
-
12. Call rich:Modal Panel from another page
mahi101987 Jan 9, 2011 12:23 PM (in response to ilya40umov)what is meant by including it to both the pages
Could you explain
i am using rich:component control to open/close the modal panel
is that fine or else should i do something else ?
Thanks
Mahi
-
13. Call rich:Modal Panel from another page
ilya40umov Jan 9, 2011 12:30 PM (in response to mahi101987)I meant this:
test1.xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml";
xmlns:ui="http://java.sun.com/jsf/facelets";
xmlns:f="http://java.sun.com/jsf/core";
xmlns:h="http://java.sun.com/jsf/html";
xmlns:rich="http://richfaces.org/rich";
xmlns:a4j="http://richfaces.org/a4j"
http://richfaces.org/a4j" template="...">
...
<ui:include src="/pages/myModalPanel.xhtml" />
...
</ui:compostion>
page2.xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml";
xmlns:ui="http://java.sun.com/jsf/facelets";
xmlns:f="http://java.sun.com/jsf/core";
xmlns:h="http://java.sun.com/jsf/html";
xmlns:rich="http://richfaces.org/rich";
xmlns:a4j="http://richfaces.org/a4j"
http://richfaces.org/a4j" template="...">
...
<ui:include src="/pages/myModalPanel.xhtml" />
...
</ui:compostion>
/pages/myModalPanel.xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml";
xmlns:ui="http://java.sun.com/jsf/facelets";
xmlns:f="http://java.sun.com/jsf/core";
xmlns:h="http://java.sun.com/jsf/html";
xmlns:rich="http://richfaces.org/rich";
xmlns:a4j="http://richfaces.org/a4j">
<rich:modalPanel id="myModalPanel">
</rich:modalPanel>
</ui:composition>
-
14. Re: Call rich:Modal Panel from another page
mahi101987 Jan 9, 2011 12:56 PM (in response to ilya40umov)yes i have done as u said
but how to open and close the modal panel
i am using rich :component control tag