I have a dataTable with cellEditors. When I start editing some line, there are 2 buttons outside the table that should change visibility. As follows:
<h:form id="formExigencias">
<p:panel id="pnlBotoes" columns="3">
<div class="direita">
<p:commandButton value="One Button to Change Visibility"
rendered="#{not exigenciaMinimaBean.emAlteracao}"
action="#{myBean.someAction()}" />
<p:commandButton value="Another Button to Change Visibility"
rendered="#{exigenciaMinimaBean.emAlteracao}"
action="#{myBean.someOtherAction()}" >
<p:confirm header="Confirmação"
message="OK?"
icon="ui-icon-alert" />
</p:commandButton>
<p:spacer height="8px" />
</div>
<p:fieldset legend="Resultado da Pesquisa">
<p:dataTable id="tabelaExigencias"
emptyMessage="Nenhuma exigência cadastrada."
value="#{exigenciaMinimaBean.exigencias}" var="exigencia"
paginator="true" rows="10" paginatorPosition="bottom"
rowsPerPageTemplate="5,10,15"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowKey="#{exigencia.id}"
selection="#{exigenciaMinimaBean.exigenciaEdicao}"
selectionMode="single" editable="true">
<p:ajax event="rowEditInit"
listener="#{exigenciaMinimaBean.rowEditInit}"
process="@this"
update=":formExigencias:pnlBotoes"/>
<!-- declarations supressed to optimize reading -->
</p:dataTable>
</p:fieldset>
</p:panel>
<p:spacer height="20px" />
</h:form>
@ManagedBean
@ViewScoped
public class ExigenciaMinimaBean {
public void rowEditInit(RowEditEvent evento) {
emAlteracao = true;
}
}
Here's what I've accomplished so far:
- If I update the panel "pnlBotoes", the buttons are correctly updated, but the row exits Editing Mode (becomes non editable again)
- If I update the buttons individually, no renders are changed and the table keeps its original state.
- Update from Backing Bean did not work.
- Presence of 'process="@this"' changes nothing
What am I doing wrong? :-(
Thanks in advance.