p:commandButton在dataTable内部不起作用-JSF

时间:2019-01-30 19:51:24

标签: jsf

我正在尝试从数据库中删除一行。我有一个带有“删除”按钮的数据表,该按钮调用了我的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>

这是我的豆子

public void Delete(Shipment shipment)  {

            db.remove(shipment);
}

当设置一个断点时,我意识到JSF没有调用bean

the firebug when i click "delete" button

0 个答案:

没有答案