I coded up your example, almost exactly as you posted it, and did not have any trouble, it worked perfectly for me.
Here's the RPG I used:
Code: Select all
H DFTACTGRP(*NO)
FTESTD CF E WORKSTN EXTFILE('SKTEST/TESTD')
F HANDLER('PROFOUNDUI(HANDLER)')
C exfmt testd1
C sigSaveId dsply
c eval *inlr = *on
Here's the display file I used:
Code: Select all
A INDARA
A R TESTD1
A 1 2HTML('QPUIREC0 ')
A 1 3HTML('{"screen":{"record format nam-
A e":"testd1"},"items":[{"id":"Button-
A 1","field type":"button","css class-
A ":"button","value":"Call Ajax Func"-
A ,"left":"112px","top":"82px","width-
A ":"115px","cursor":"default","oncli-
A ck":"ScottKlement.paulAjax();"},{"i-
A d":"sigSaveId","field type":"textbo-
A x","css class":"input","value":{"fi-
A eldName":"SigSaveId","dataLength":"-
A 10","trimLeading":"false","trimTrai-
A ling":"true","blankFill":"false","r-
A jZeroFill":"false","dataType":"char-
A ","formatting":"Text","textTransfor-
A m":"none","designValue":"[SigSaveId-
A ]"},"left":"68px","top":"137px","vi-
A sibility":"hidden"},{"id":"Button2"-
A ,"field type":"button","css class":-
A "button","value":"Return to RPG","l-
A eft":"191px","top":"194px","width":-
A "108px","cursor":"default","respons-
A e":{"fieldName":"btnRtnRpg","dataTy-
A pe":"indicator","formatting":"Indic-
A ator","indFormat":"1 / 0"}}]}')
A BTNRTNRPG 1A H
A SIGSAVEID 10A H
And he'res the JavaScript I used to make it work
Code: Select all
var ScottKlement = { }
ScottKlement.paulAjax = function() {
ajaxJSON({
url: "/ScottTemp/paulJson.txt",
params: {
sig: "sig here",
name: "image name here"
},
method: "post",
async: true,
handler: ScottKlement.infoHandler
});
}
ScottKlement.infoHandler = function(obj) {
alert("result; " + obj.data);
if (obj.data != 'success') {
changeElementValue("sigSaveId", 'N');
} else {
changeElementValue("sigSaveId", 'Y');
}
alert(get('sigSaveId'));
}
This worked perfectly for me