Possible to use javascript to fire CloseEvent?

UI Components for JSF
Post Reply
foxleung
Posts: 5
Joined: 20 Oct 2011, 00:17

02 Dec 2011, 17:35

this is the code for my modal popup:

Code: Select all

		<p:dialog header="Modal Dialog" modal="true" widgetVar="popup">
			<ui:include src="popup.xhtml"/>
			<p:ajax event="close" listener="#{mainBean.listenForResultFromPopup}" update="..."/>
		</p:dialog>
because the only application event of PF Dialog now is "Close", I'm using it to listen for "Close" event of the modal popup and update a part in my main page.

But popup.xhtml is actually a search view, I need the clicking of a button inside it to update properties in its managed bean: popup.java. If I want to fire the "Close" event, it has to be in another different JSF life cycle, because "Close" acts like a "cancel" button and extends AjaxBehaviorEvent, right? That's why I am looking for ways to fire "Close" event in my modal dialog without user input (clicking "X").

Thanks in advance.
Primefaces 3.0.M3; Mojarra 2.1.2; JBoss 7.0.1+Eclipse 3.7

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests