java - ContextMenu doesn't invoke delete in managedbean -
i'm new in jsf , want use contextmenu of primeface delete method.but delete methode never invoked. here parts of code.i don't know mistake
<p:datatable id="datatable" var="bon" widgetvar="bontable" value="#{bonessencebean.allbonessence}" rowkey="#{bon.idbon}" selection="#{bonessencebean.bonessence}" selectionmode="single" sortmode="single" rows="10" paginator="true" paginatortemplate="{currentpagereport} {firstpagelink} {previouspagelink} {pagelinks} {nextpagelink} {lastpagelink} {rowsperpagedropdown}" rowsperpagetemplate="10,15,25"> <f:facet name="header"> <p:outputpanel> <h:outputtext value="search:" style="height:30px"/> <p:inputtext id="globalfilter" onkeyup="bontable.filter()" style="width:150px" /> </p:outputpanel> </f:facet> <!-- <p:ajax event="rowedit" listener="#{bonessence.updatebon}" /> --> <!-- <p:ajax event="roweditcancel" listener="#{tablebean.oncancel}" update=":form:messages" /> --> <p:column sortby="#{bon.idbon}" headertext="id bon" filterby="#{bon.idbon}" filtermatchmode="contains"> #{bon.idbon} </p:column> <p:column sortby="#{bon.vehicule.immat}" headertext="vehicule:" filterby="#{bon.vehicule.immat}" filtermatchmode="contains"> #{bon.vehicule.immat} </p:column> <p:column sortby="#{bon.quantite}" headertext="quantité:" filterby="#{bon.quantite}" filtermatchmode="contains"> #{bon.quantite} </p:column> <p:column sortby="#{bon.prix}" headertext="prix" filterby="#{bon.prix}" filtermatchmode="contains"> #{bon.prix} </p:column> <p:column sortby="#{bon.datebon}" headertext="date" filterby="#{bon.datebon}" filtermatchmode="contains"> #{bon.datebon} </p:column> <p:column> <p:commandbutton value="imprimer" icon="ui-icon-search" oncomplete="printdialog.show()" > <f:setpropertyactionlistener target="#{bonessencebean.bonessence}" value="#{bon}"></f:setpropertyactionlistener> </p:commandbutton> </p:column> <p:column> <h:commandbutton value="delete" update="datatable" icon="ui-icon-close" actionlistener="#{bonessencebean.deletebo}" > <f:setpropertyactionlistener target="#{bonessencebean.bonessence}" value="#{bon}"></f:setpropertyactionlistener> </h:commandbutton> </p:column> <!-- <h:column headertext="delete"> <h:commandlink id="delete" actionlistener="#{bonessencebean.deletebon}"> <h:outputtext value="delete" /> <f:param id="deleteid" name="id" value="#{bonessence.idbon}" /> </h:commandlink> </h:column>--> </p:datatable> </h:form>
managed
public void deletebon(actionevent event){ system.out.println("delete"); essenceservice.deletebon(bonessence); }
and deletebon never invoked
if dont gonna use actionevent, can try this:
<h:commandlink id="delete" action="#{bonessencebean.deletebon()}"> public void deletebon(){ system.out.println("delete"); essenceservice.deletebon(bonessence); }
Comments
Post a Comment