Search Support
-
Nasir NSeptember 24, 2017 at 12:13 am #4615
I have a form with 5 text fields and defined a complex variable (person.input1, person.input2,….). On one of the input text box on onChange event (binding is person.input3), I am calling ${Service_Call}.execute() to call an ajax service. I need to pass that text box value to ajax service but no data is passed and its undefined.
I have defined input to ajax service as “data” of string type and output is results of String type. In Configuration (under Behavior) of service call, I have attached the ajax service and input value selected as person.input3. Am I doing anything wrong?
SPARK SupportSeptember 25, 2017 at 10:01 am #4625Hi Nasir,
This configuration should work. Are you able to do a getData() on your Text control bound to person.input3 and ensure that the input is captured into the variable?
Also, you may wish to place some code to debug the service in the On Result and On Error events such as:
console.log(“Service Result: ” + me.getResult());
Regards,
Stephen P.
Nasir NOctober 1, 2017 at 10:56 pm #4690Thank you, Stephen.
This is working.
If I define “result” as complex object and not as a string for ajax service, how to retrieve it in my coach view. For example, I have object.var1 and need to get the value of var1.
SPARK SupportOctober 9, 2017 at 10:33 am #4720Hi Nasir,
The Service Call method getResult() should return the object that you have defined in your service. You can either set the return value of getResult() to a variable, or access the property directly such as me.getResult().var1.
Regards,
Stephen P.
-
|
You must be logged in to reply to this topic.