<h:form prependId="false">
<p:dialog modal="true">
<p:commandLink ajax="true" value="ok" actionListener="Bean.listenerMethod"/>
</p:dialog>
</h:form>
I had some other controls too inside the form. When the link is clicked that listener was not fired. What might be the problem? please help!
You need to declare it as EL method expression, not as a plain string.
To be sure, the
#{Bean}must be a valid managed bean with the managed bean name"Bean"which in turn contains the following methodwhere
ActionEventis from thejavax.facespackage and not thejava.awtone.If that still doesn’t work, then it’s caused by something else. E.g. the form is nested, the
renderedattribute evaluatedfalse, etc. For an overview, see this answer.