I have a problem, as I can delete the records of a datatable at the time of clicking on a button again, so that to click on the new button the datatable is loaded:
This is the button to add a new one:
public void actionNuevo() {
flagIU = false;
this.assignmentVO = null;
this.routeVo=null;
this.vehicleVOBo = null;
customFieldsTrip = new ArrayList<>();
}
This is the datatable code:
<p:dataTable id="tablas_tri" scrollable="true" scrollWidth="100%" value="#{routeAssignmentBean.customFieldsTrip}" var="fieldTrpVO" rowIndexVar="rowIndex">
<p:column headerText="Tripulante1">
<p:outputLabel value="#{fieldTrpVO.name_employee}" />
</p:column>
<p:column headerText="" style="max-width: 35px">
<p:commandButton icon="ui-icon-close" title="remove from cart"
accesskey="" process="@this" actionListener="#{routeAssignmentBean.deleteTripulante(fieldTrpVO)}"
update="tablas_tri"
style="width:22px;height:22px;background-color:#FF0000;"/>
<p:commandButton rendered="${beanVehicle.bottonEditarP}" class="btn-editar" value="" process="@this" title="Editar" actionListener="${routeAssignmentBean.selectCustomTripulante(fieldTrpVO)}" update="form_routes:nombreTripulante"/>
</p:column>
</p:dataTable>
This is the screen of what happens when I click on the button:
Previously he had clicked on the new one again and it was not deleted, there is some way that it is no longer shown, I hope and you can help me please, greetings and I am on the lookout.