-
1. Re: pls help - click
ilya_shaikovsky Nov 18, 2008 5:46 AM (in response to valatharv)<h:form> <h:outputText value="#{userBean.name}" id="update"/> <h:outputLink value="#" id="link"> Show Modal Panel <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick" /> </h:outputLink> </h:form> <rich:modalPanel id="panel" width="350" height="100"> <f:facet name="header"> <h:panelGroup> <h:outputText value="Modal Panel"></h:outputText> </h:panelGroup> </f:facet> <h:outputText value="This panel is called using Component Control Component"></h:outputText> <h:panelGroup> <h:form> <h:inputText id="panelText1" required="true" value="#{userBean.name}" /> <a4j:commandLink value="Save" style="cursor:pointer" id="hidelink" reRender="update" oncomplete="#{rich:component('panel')}.hide();"/> </h:form> </h:panelGroup> </rich:modalPanel>
works fine for me. -
2. Re: pls help - click
valatharv Nov 22, 2008 10:35 AM (in response to valatharv)Thanks for the reply... I am facing small issue while including modal code to main xhtml.
When I include TestPop.xhtml (which contains modal code) in Main xhtml, it shows the menu bar & footer because of "template="layout/template.xhtml"" (thus menu & header is displayed twice in main page).
If I try to remove template from TestPop.xhtml nothing happens on clicking modal link from main page.
Please suggest how can we handle this....
Main xhtml
----------
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 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"
template="layout/template.xhtml">
<ui:define name="body">
<h:form>
<h:outputText value="test" id="update"/>
<h:outputLink value="#" id="link">
Show Modal Panel
<rich:componentControl for="panel" attachTo="link" operation="show"
event="onclick" />
</h:outputLink>
</h:form>
<ui:include src="/TestPop.xhtml"/>
</ui:define>
</ui:composition>
TestPop.xhtml
-------------
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 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"
template="layout/template.xhtml">
<ui:define name="body">
<rich:modalPanel id="panel" width="350" height="100">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Modal Panel"></h:outputText>
</h:panelGroup>
</f:facet>
<h:outputText
value="This panel is called using Component Control Component"></h:outputText>
<h:panelGroup>
<h:form>
<h:inputText id="panelText1" required="true"
value="Vishal" />
<a4j:commandLink value="Save" style="cursor:pointer" id="hidelink" reRender="update" oncomplete="#{rich:component('panel')}.hide();"/>
</h:form>
</h:panelGroup>
</rich:modalPanel>
</ui:define>
</ui:composition> -
3. Re: pls help - click
ilya_shaikovsky Nov 24, 2008 4:30 AM (in response to valatharv)in order to remove template attribute from included ui:composition succsessfully - please remove also ui:define tags there.
-
4. Re: pls help - click
valatharv Nov 25, 2008 6:18 PM (in response to valatharv)Thanks for replying Ilya...
I have a query, how can we pass parameter from main.xhtml to modal panel which is new xhtml...
s:button below works fine param values are passed, I am stuck in passing when I try to open modal panel...
pls help.
<h:form>
<h:outputLink value="#" id="link">Add treatment
<rich:componentControl for="panel" attachTo="link" operation="show"
event="onclick"/>
<f:param name="reagentHjid"
value="#{info.hjid}"/>
<f:param name="treatmentFrom" value="Reagent"/>
</h:outputLink>
<s:button
value="Add treatment"
view="/TreatmentEdit.xhtml">
<f:param name="reagentHjid"
value="#{info.hjid}"/>
<f:param name="treatmentFrom" value="Reagent"/>
</s:button>
</h:form>
<ui:include src="/TreatmentEdit.xhtml"/>