I am retrieving a value from a form
var programName = xfa.resolveNode("form1.page1.subApprovedTrainingNAC.subEd[" + oWrapper.index + "].educationInstance.lstPrograms").rawValue;
when I attempt to pass it to my function
callRestService(url,lstPrograms,programName);
the function receives it as null
However if in between the two statesments I have
alert("programName before click call: " + programName);
then the value is received correctly.
How can I get value to the function with the value without showing the alert?
Solved! Go to Solution.
Views
Replies
Total Likes
Since setting the time out on the callRestService didn't work, I wound up using
var programName = xfa.resolveNode("form1.page1.subApprovedTrainingNAC.subEd[" + oWrapper.index + "].educationInstance.lstPrograms").rawValue;
var myTO = app.setTimeOut("var site = programName; app.clearTimeOut(myTO) ;", 5000) ;
Then sent the call as before
callRestService(url,lstPrograms,programName);
and it is now working
Hi,
If the value is coming correctly only with alert then it is because by the time callRestService the value is not populating to programName variable. With alert you are buying sometime for variable to populate before passing to method.
Try adding timeout then it will work fine without alert or make the calls as sync instead of async
Hope this helps !
I tried this
var myTO = app.setTimeOut("callRestService(url,lstPrograms,programName)",5000) ;
but function is not responding.
Since setting the time out on the callRestService didn't work, I wound up using
var programName = xfa.resolveNode("form1.page1.subApprovedTrainingNAC.subEd[" + oWrapper.index + "].educationInstance.lstPrograms").rawValue;
var myTO = app.setTimeOut("var site = programName; app.clearTimeOut(myTO) ;", 5000) ;
Then sent the call as before
callRestService(url,lstPrograms,programName);
and it is now working
Views
Likes
Replies
Views
Likes
Replies