what want basic row selection example @ primefaces showcase(http://www.primefaces.org/showcase/ui/datatablerowselectionbycolumn.jsf) want update datatable's row. problem when click update button @ datatable, dialogbox appears validation errors.
second thing order of method execution times.(action-update-onclick-f:setpropertyactionlistener)
<p:commandbutton id="updatebuttonid" action="#{mycontroller.showcompanyeditpanel}" update=":tabview:companyform:companyeditpanel" onclick="companydialog.show()" icon="ui-icon-pencil" title="update"> <f:setpropertyactionlistener value="#{company}" target="#{mycontroller.selectedcompany}" /> </p:commandbutton> <p:dialog id="editcompanydialogid" header="companyedit" widgetvar="companydialog" resizable="false"> <p:panel id="companyeditpanel" > //some stuff here </p:panel> </p:dialog>
you seem missing major point of using <p:commandbutton> here, seem mixing client-side , server-side events.
first on <p:commandbutton>. component designed post (partial) form data current url, business job in action(listener) method , return updated components / perform navigation. can of course 'attach' javascript events attributes.
second, onclick, oncomplete, , other on... attribute corresponding client-side events. in particular, onclick function triggered when button clicked, oncomplete function called when dom updated after ajax call, i.e. elements specified in <p:ajax update="..."> or in update="..." attribute of <p:commandbutton>.
third, action listeners (thus, actionlistener attribute, <f:actionlistener> tag, <f:setpropertyactionlistener> tag) executed right in order specified in tag, see this answer more elaboration. last 1 executed action method, after response sent back.
Comments
Post a Comment