プログレス バーが完了した後でコマンド ボタンを有効にしようとしていますが、ページを読み込むと、コマンド ボタンは既に有効になっていますが、それ以外は正常に動作します。
私はいくつかの調査と同様の問題 を行いました。最初にdisable="true"のときにcommandButtonが機能 しないしかし、解決策はうまくいきませんでした。
私が間違っていることは何ですか?足りないものはありますか?
これはindex.xhtmlです
<p:growl id="growl" />
<h3>Deskarga</h3>
<p:messages id="messages" showDetail="true" autoUpdate="true"
closable="true" />
<p:commandButton value="Start" type="button"
onclick="pbAjax.start();startButton2.disable();"
widgetVar="startButton2" />
<p:commandButton value="Cancel"
actionListener="#{progressBean.cancel}"
oncomplete="pbAjax.cancel();startButton2.enable();" />
<p:progressBar widgetVar="pbAjax" ajax="true" rendered="true"
value="#{progressBean.progress}" labelTemplate="{value}%"
styleClass="animated" interval="250">
<p:ajax event="complete" listener="#{progressBean.onComplete}"
update="messages"
oncomplete="startButton2.enable();#{progressBean.setDisabled(false)};"/>
</p:progressBar>
<p:separator id="separator2" />
<p:commandButton value="Parseatu" widgetVar="parserButton" ajax="true"
disabled="#{progressBean.disabled}" actionListener="#{progressBean.parseatu()}"
update="growl" />
</h:form>
そして、これはセッション スコープのマネージド Bean です。
public class ProgressBean implements Serializable {
private boolean disabled= true;
public boolean isDisabled() {
return disabled;
}
public void setDisabled(boolean disabled) {
this.disabled= disabled;
}
}