0

I'm triying to delete a row from the database . I have a datatable with a button "delete" that call my bean

<h:dataTable id="InfoTable" value="#{shipmentBean.getDocs()}"
                        var="o" pt:data-widget="datatable" pt:data-searching="true"
                        pt:data-scrollaxis="x" pt:data-info="true"
                        pt:data-ordering="true" pt:data-paging="true"
                        pt:data-col-Reorder="true" pt:data-dom="lfrtBip"
                        pt:data-buttons='[{"extend":"excel", "text":"Export to Excel", "className":"ibm-btn-pri
                     ibm-btn-blue-50 ibm-btn-small", "messageTop": null, "messageBottom": null, "title": null}]'
                        styleClass="ibm-data-table ibm-altcols ibm-padding-small nowrap ">
                        <h:column>
                            <f:facet name="header">Delete Shipment</f:facet>
                            <p:commandButton value="delete" id="submitButton" type="submit"
                                action="#{reportBean.delete()}" 
                                styleClass="ibm-btn-pri ibm-btn-gray-50 ibm-btn-small"
                             />
                        </h:column> </h:dataTable>

this is my bean

public void Delete(Shipment shipment)  {

            db.remove(shipment);
}

when put a breakpoint I realize that JSF didn't call the bean

the firebug when i click "delete" button

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Enzo Zalazar
  • 13
  • 1
  • 1
  • 5
  • 1
    See https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value – Jasper de Vries Jan 30 '19 at 20:00
  • 1
    `void delete(void)` is not the same as `void Delete(Shipment)`. Also make sure your `dataTable` or `commandButton` is inside a `h:form`. – Adam Waldenberg Jan 31 '19 at 03:21
  • Possible duplicate of [commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated](https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) – Kukeltje Jan 31 '19 at 06:57

0 Answers0