This content has been marked as final.
Show 2 replies
-
1. Re: modal question.
ilya_shaikovsky Jul 14, 2008 8:19 AM (in response to madhav_inamti)so just update message on the main page with reRender or use rich:messages.
-
2. Re: modal question.
madhav_inamti Jul 14, 2008 8:00 PM (in response to madhav_inamti)Ilya,
Can you please explain with code. It has been holding me up for sometime.
Here's what I have
Main Page<ui:define name="main_content"> <h:messages id="mainMessage" styleClass="message" rendered="true"/>
Button to invoke Modal<a:commandLink reRender="modalFooContent" eventsqueue="foo" oncomplete="Richfaces.showModalPanel('addFoo',{width:650, top:200})"> <h:outputText value="Add/Edit Foo"/> </a:commandLink>
AddFoo Modal<a:form id="modalFooContent"> <rich:messages id="modalMessages" styleClass="message" globalOnly="true" ajaxRendered="true"/>
Button inside Modal<a:commandButton id="save" value="Save Foo" action="#{fooFoo.saveFoo}" oncomplete="javascript:closeModalPanel('addFoo');" reRender="mainMessage" eventsQueue="foo" view="#" />
and in fooFoo.saveFoo I haveFacesMessages.instance().addToControl("mainMessage", FacesMessage.SEVERITY_INFO, "Foo saved successfully");
After clicking the button on the modal, I do not see the message anywhere. The modal closes immediately. I want this message to appear in the main page with the control that has id "mainMessage".