p:commandButton 不执行单击操作我有下表
<p:dataTable id="firmasTabla" var="car" editable="true" editMode="cell" value="#{clientesMB.itemsPersonaFirmanUtil}" widgetVar="carsTable">
<p:ajax event="cellEdit" listener="#{clientesMB.modiCellPersonaFirma}" update=":form2:growl" />
<p:column headerText="Nro CI" style="width:30%">
<p:cellEditor>
<f:facet name="output"><h:outputText value="#{car.ci}" /></f:facet>
<f:facet name="input"><p:inputText id="modelInput" value="#{car.ci}" style="width:96%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Nombre" style="width:60%">
<p:cellEditor>
<f:facet name="output"><h:outputText value="#{car.nombre}" /></f:facet>
<f:facet name="input"><p:inputText id="modelInput2" value="#{car.nombre}" style="width:96%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:10%">
<p:commandButton id="selectButton256" actionListener="#{clientesMB.deleteSelecPersonaFirmaCliente}"
icon="ui-icon-trash" title="Eliminar" update="firmasTabla">
<f:setPropertyActionListener value="#{car}" target="#{clientesMB.personaFirmasSelect}" />
</p:commandButton>
</p:column>
</p:dataTable>
而且我必须单击两次才能运行该操作,有时是第一次。在 backingbean 中有以下方法:
public void deleteSelecPersonaFirmaCliente() throws Exception {
try {
boolean b = this.getItemsPersonaFirmanUtil().remove(personaFirmasSelect);
boolean b1 = b;
} catch (Exception e) {
JsfUtil.addErrorMessage(e, "Error: deleteSelecPersonaFirmaCliente() " + e.getMessage());
}
}
调试时,第一次单击进入方法,但好像在列表中找不到要删除的对象。然后单击 sugundo 删除列表对象。