There is some way to pass action in <rich:modalPanel>
. I want to write simple popup with "Yes" and "No" button, and I want to reuse this popup in different pages, that's why I need that different action was invoked when "Yes" button pressed. There is a way to pass some value in <rich:modalPanel>
with <a4j:actionparam>
:
<a4j:commandButton value="See details…" id="det"
reRender="popup_dataIdField, …">
<rich:componentControl for="popup"
operation="show" event="onclick" />
<a4j:actionparam name="message" assignTo="#{popupBean.message}"
value="#{myBean.message}" />
</a4j:commandButton>
But is some way to pass action ?
I find the answer by myself :). Maybe it will be helpful for somebody.
I've done this using Facelets. When I'm include popup to my page I pass parametr to it:
<ui:include src="./WEB-INF/popup/popup.xhtml">
<ui:param name="yesAction" value="${thisPageBean}" />
</ui:include>
Where thisPageBean
- is bean from what popup invoked.
Then in my popup I wrote:
<a4j:commandButton id="yesButton" value="#{msgs.yesButton}"
action="#{yesAction.someAtion}"
</a4j:commandButton>
And with this I invoke thisPageBean.someAtion
. All magic is ${thisPageBean}
, it's is necessary to us $
but no #
.