-1
I have a button to delete a file that I just want to appear to the user if my class has records. Just follow his code:
<p:commandButton icon="ui-icon-trash"
value="Excluir"
actionListener="#{deParaBean.deletar}"
oncomplete="PF('dlg1').hide"
update=":mainForm"
disabled="#{deParaBean.temRegistros}"
ajax="false"/>
I want his disabled property to receive true or false according to the temRegistros method I implemented in my bean. Follow his code:
public boolean temRegistros(){
if (itemParceria == null) {
return false;
} else {
return true;
}
}
However, when I start the server and upload the application, before rendering the screen, the following error appears to me:
javax.servlet.Servletexception: /pages/depara.xhtml @111,23 disabled="#{deParaBean.temRegistros}": The class 'br.com.parceria.bean.Deparabean' does not have the Property 'temRegisters'.
Someone knows what I did wrong?
Try to rename the method to getTemRegisters, and keep disabled="#{deParaBean.temRegisters}"
– thiaguerd