primefaces命令按钮标签更改后点击

问题描述:

我有一个commandbutton插入数据到数据库。点击后我想更改按钮标签,然后它将被禁用。primefaces命令按钮标签更改后点击

我该怎么办呢?

用布尔值在烘焙豆

在bean尝试

boolean buttonDisabled = false; 

.xhtml

<p:commandButton "#{yourBean.buttonDisabled ? 'old label' : 'new label'}" disabled="#{yourBean.buttonDisabled}"> 
    <f:setPropertyActionListener value="true" 
     target="#{yourBean.buttonDisabled}" /> 
</p:commandButton>