PF 3.5 - Request Context added callback param is undefined in oncomplete javascript -Tomcat 9.0.1 , JSF 2.0, Myfaces2.0

UI Components for JSF
Post Reply
prathapd
Posts: 1
Joined: 14 Dec 2017, 13:14

14 Dec 2017, 13:23

My XHTML code:

Code: Select all

<p:commandButton value="Submit" style="margin:auto;"
				actionListener="#{myFormBean.submit()}"
				oncomplete="handleSubmit(xhr, status, args);"
				update=":myForm" />
				
				function handleSubmit(xhr, status, args){
				if (args &amp;&amp; typeof(args.validData)!='undefined' &amp;&amp; args.validData) {
					confirmationDiagWdt.show();
				}else if (args &amp;&amp; !args.validData){
					dispDiagWdt.show();
				}
			}
My Bean code:

Code: Select all

	public void submit(){
		boolean validData = false;
		try {
			validData = validateCampaignInput();
			//RequestContext.getCurrentInstance().execute("confirmationDiagWdt.show()"); -- this is also not working
		} catch (Exception e) {
			e.printStackTrace();
		}
		RequestContext.getCurrentInstance().addCallbackParam("validData", validData);
	}
RESPONSE: When i put alert in handleSubmit() as args.validData -> getting undefined. WHY REQUEST CONTEXT NOT ADDING CALL BACK PARAM validData in response?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

15 Dec 2017, 13:07

Did you check the network response/data

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 43 guests