I’ve got some some troubles with Primefaces 3.2 and JSF 2.1.
My Code like this:
<p:toolbar id="jeditortoolbar" styleClass="jeditortoolbar">
<p:toolbarGroup align="left" height="25" style="height:25px">
<p:commandButton type="button" title="#{msg.beenden}"/>
<p:commandButton type="button" title="#{msg.neu}"/>
</p:toolbarGroup>
</p:toolbar>
When I take a look at Primefaces Showcase my p:commandButton need
actionListener="#{myBean.myActionMethod}"
and my Bean need a Method like
public void myActionMethod(){}
I have a h:form around my p:toolbar tag!
My Bean is ViewScoped.
My Workaround is
In *.xhtml File
<p:commandButton type="button" title="#{msg.neu}" onclick="addNewEmptyFile()"/>
<p:remoteCommand name="addNewEmptyFile" update=":codeTabForm">
<f:setPropertyActionListener value="#{true}" target="#{myBean.myEvent}"/>
</p:remoteCommand>
In MyBean.java
private String myEvent;
public void setMyEvent(String value){ myActionMethod();}
This works for me but I think this is very dirty code.
Can everyone help me?
Try this
Bean.java
page.xhtml