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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -