2017-05-08 98 views

回答

1

用布爾值在烘焙豆

在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>