jsf 2 - Primefaces commandbutton clientside variable -
i'm migrating richfaces primefaces.
<a4j:commandbutton id="editstatusbuttonid" data="#{userto.emailidmandatorystatus}" action="#useradministration.editstatusbuttonaction}" oncomplete="if(data=='#{useradministration.configureemailsettingstatus}')/>
i need replace attribute data in primefaces commandabutton.
it comes callback parameter in primefaces, on requestcontext
component.
i'm going "borrow" generously manual.
from backing bean:
requestcontext requestcontext = requestcontext.getcurrentinstance(); requestcontext.addcallbackparam("mandatorystatus", userto.emailidmandatorystatus); //isvalid parameter
in page, in js function:
var mandatorystatus= args.mandatorystatus;
it has same semantics in rf; values serialized json, in rf; data made available on args
object, in rf - event.data
putting together, can have:
<p:commandbutton id="editstatusbuttonid" action="#{useradministration.editstatusbuttonaction}" oncomplete="if(args.mandatorystatus=='#{useradministration.configureemailsettingstatus}')/>
Comments
Post a Comment