-
1. Dynamically passing bean to rich:popupPanel
mp911de May 14, 2011 7:50 AM (in response to nikh123123)Hi Nikhil,
define a own variable Name for the interchangeable Bean. Then, when you step on your page you set the current bean to your generic variable.
e.g. public void showPopupFromBean1()
{
Bean1 bean1 = getBean1();
FacesContext.getExternalContext().getSessionMap().put("currentBean", bean1);
}
Best regards,
Mark
-
2. Dynamically passing bean to rich:popupPanel
iabughosh May 14, 2011 6:20 PM (in response to nikh123123)if you want to make your pop up common, attach it to a separate bean then send the current bean to the pop up bean :
<a4j:commandButton value="show"
render="popupID"
oncomplete="#{rich:component('popupID')}.show();return false;">
<f:setPropertyActionListener value="#{user.currentBean}" target="#{user.popupBean}" />
</a4j:commandButton>
<rich:popupPanel id="popupID"
domElementAttachment="form">
<h:outputText value="#{user.popupBean.value}" />
<h:commandButton value="close"
onclick="#{rich:component('popupID')}.hide();return false;"/>
</rich:popupPanel>