Primeface 3.2とJSF 2.1にいくつかの問題があります。Primefaces p:アクションが呼び出されていないcommandButton
このようなマイコード:
<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>
私は私のpを展示Primefacesを見てみましょう:commandButtonのは
actionListener="#{myBean.myActionMethod}"
を必要とする、私のビーンが
public void myActionMethod(){}
のような方法を必要とします私はp:toolbar
タグの周りにh:form
を持っています!
My BeanはViewScopedです。
私の回避策は、これが私の作品 MyBean.java
private String myEvent;
public void setMyEvent(String value){ myActionMethod();}
でファイル
<p:commandButton type="button" title="#{msg.neu}" onclick="addNewEmptyFile()"/>
<p:remoteCommand name="addNewEmptyFile" update=":codeTabForm">
<f:setPropertyActionListener value="#{true}" target="#{myBean.myEvent}"/>
</p:remoteCommand>
*.xhtml
であるが、私は、これは非常に汚いコードだと思います。
誰も助けてくれますか?
どこに問題がある?page.xhtml
この
Bean.javaをお試しくださいショーケースのようにしようとするとどうなりますか? –
ActionListener Methodeを追加すると、イベントは呼び出されません。 – user1740789
コマンドボタンから 'type =" button "'を削除しようとしましたか? –