jsf - use <p:commandbutton> in <p:datatable> to show a <p:dialog> -
hello trying implement primefaces commandbuttons in p:datatable. need identical post: f:setpropertyactionlistener not invoked
basically need have column of buttons in , click on 1 button pass object of current row bean, , dialog pop out, showing information of chosen object.
the following relevant code:
<f:view> <body> <h:form id="theform"> <p:datatable id="testfailures" value="#{testdetails.report.failures}" var="failure" styleclass="basetable"> <p:column id="requestcolumn"> <f:facet name="header"> <h:outputtext value="request" id="requestheadertext" /> </f:facet> <p:commandbutton value="detail" update="requestdialog" oncomplete="pf('dlg1').show();" type="button"> <f:setpropertyactionlistener target="#{testdetails.selectedfailure}" value="#{failure}" /> </p:commandbutton> <h:message for="requestdialog" /> <p:dialog id="requestdialog" header="request dialog" widgetvar="dlg1" dynamic="true"> <h:outputtext value="#{selectedfailure.request}" /> </p:dialog> </p:column> </p:datatable> </h:form> <h:message for="theform" /> <h:message for="responsedialog" /> <p:dialog id="responsedialog" header="request dialog" widgetvar="dlg2" dynamic="true"> <h:form> <h:outputtext value="#{selectedfailure.request}" /> </h:form> </p:dialog> </body> </f:view> i tried put dialog in different positions (see "dlg1" , "dlg2"). neither works. no dialog showing. not show either. , don't see error message in browser's console window. (i think there exclamation warning).
i have tried debug mode, , set method property "selectedfailure" not called.
try remove type="button" commandbutton , should work. dialogs should not placed inside datatables position of "dlg2" more correct.
Comments
Post a Comment