I'm trying to make a logic of making the excel
export button disabled to the user by clicking the search button if the number of records is equal to zero. The problem is that the first time it works normal, but the second time the button is no longer rendered again.
<f:facet name="footer">
<p:row>
<p:column style="text-align: right" colspan="4">
<p:commandButton id="bt_filtrar" value="#{lbl['BOTAO.FILTRAR']}" process="filtro" actionListener="#{propostaCartaoListBean.buscar}" update="tabela br_exportar"/>
<p:commandButton id="bt_limpar" icon="botaoLimpar" title="#{lbl['BOTAO.LIMPAR']}"/>
<p:commandButton id="bt_exportar" icon="botaoExcel" ajax="false" disabled="#{propostaCartaoListBean.lazyModel.rowCount == 0}" title="#{lbl['BOTAO.EXPORTAREXCEL']}">
<p:dataExporter type="xls" target="tabela" fileName="propostaCartao" />
</p:commandButton>
</p:column>
</p:row>
</f:facet>
This button is at the end of a panelGrid
and above a datatable
.
How do I solve this problem of missing component rendering?