I'm trying to open dialog using Primefaces 4 dialog framework,
public void openDialog(String viewName) {
RequestContext.getCurrentInstance().openDialog(viewName);
}
This works:
<p:commandButton value="Click" action="#{impaktDialogBean.openDialog('/popup/test2')}"/>
This doesn't:
<p:commandButton value="Click">
<p:ajax event="click" listener="#{impaktDialogBean.openDialog('/popup/test2')}" ></p:ajax>
</p:commandButton>
So, Primefaces dialog framework only works with action & actionListener?????
I'm using:
- Primefaces 4
- Tomcat 7
- JSF 2.2.6 Mojarra
Thanks.
You have this:
So when you do this:
You recieve this in your Ajax response:
So, you can try this:
You can even use the return value:
The AJAX is just to turn the outcome to the destination url. If you already have the destination url, you dont need to do it. In my basic tests this works well, exactly like the original, except that you must pass the destination address in the 'url' field, not the outcome.
Hope this helps.