Hidden input textbox in JS not returning value to RPG
Posted: Mon Aug 24, 2020 7:38 pm
To Whom It May Concern,
I have written a function, "getGridSortProperties", that it being performed within the OnSubmit of the CTL record format.
It correctly returns a structured return value containing 3 values; a Column List, an Order List, and a Direction List.
I am attempting to return the "GridSortProperties" for 2 grids; SFLC80 and SFLC20.
I defined, in the Visual Designer, 6 textbox elements with input CSS and named them; C80COLLIST, C80ORDLIST etc. as seen below.
The values appear to be correctly assigned via pui.set because I later reference them in the alert keyword.
let C80Lists = getGridSortProperties('SFLC80');
pui.set("C80COLLIST",C80Lists.sortColList);
pui.set("C80ORDLIST",C80Lists.sortOrdList);
pui.set("C80DIRLIST",C80Lists.sortDirList);
let C20Lists = getGridSortProperties('SFLC20');
pui.set("C20COLLIST",C20Lists.sortColList);
pui.set("C20ORDLIST",C20Lists.sortOrdList);
pui.set("C20DIRLIST",C20Lists.sortDirList);
if (C80Lists.sortColList != ""
|| C20Lists.sortColList != "") {
alert(
'Grid SFLC80'
+ '\nColumn List: ' + getElementValue("C80COLLIST")
+ '\nOrder List: ' + getElementValue("C80ORDLIST")
+ '\nDirection List: ' + getElementValue("C80DIRLIST")
+ '\n'
+ '\nGrid SFLC20'
+ '\nColumn List: ' + getElementValue("C20COLLIST")
+ '\nOrder List: ' + getElementValue("C20ORDLIST")
+ '\nDirection List: ' + getElementValue("C20DIRLIST")
);
};
However, when the CTL record format in which these 6 DIV textbox elements reside is read in by the RPG program the values in the returned data structure for these elements are blank. Am I missing something?
The purpose of the function is to allow client-side sorting to be performed (by NOT specifying the column sort response/field name sort response property and NOT the specifying return sort order property) but still pass back the response information to the RPG program so it can perform any task where that information would be useful.
Regards,
Marc Passmoor
Revolos
I have written a function, "getGridSortProperties", that it being performed within the OnSubmit of the CTL record format.
It correctly returns a structured return value containing 3 values; a Column List, an Order List, and a Direction List.
I am attempting to return the "GridSortProperties" for 2 grids; SFLC80 and SFLC20.
I defined, in the Visual Designer, 6 textbox elements with input CSS and named them; C80COLLIST, C80ORDLIST etc. as seen below.
The values appear to be correctly assigned via pui.set because I later reference them in the alert keyword.
let C80Lists = getGridSortProperties('SFLC80');
pui.set("C80COLLIST",C80Lists.sortColList);
pui.set("C80ORDLIST",C80Lists.sortOrdList);
pui.set("C80DIRLIST",C80Lists.sortDirList);
let C20Lists = getGridSortProperties('SFLC20');
pui.set("C20COLLIST",C20Lists.sortColList);
pui.set("C20ORDLIST",C20Lists.sortOrdList);
pui.set("C20DIRLIST",C20Lists.sortDirList);
if (C80Lists.sortColList != ""
|| C20Lists.sortColList != "") {
alert(
'Grid SFLC80'
+ '\nColumn List: ' + getElementValue("C80COLLIST")
+ '\nOrder List: ' + getElementValue("C80ORDLIST")
+ '\nDirection List: ' + getElementValue("C80DIRLIST")
+ '\n'
+ '\nGrid SFLC20'
+ '\nColumn List: ' + getElementValue("C20COLLIST")
+ '\nOrder List: ' + getElementValue("C20ORDLIST")
+ '\nDirection List: ' + getElementValue("C20DIRLIST")
);
};
However, when the CTL record format in which these 6 DIV textbox elements reside is read in by the RPG program the values in the returned data structure for these elements are blank. Am I missing something?
The purpose of the function is to allow client-side sorting to be performed (by NOT specifying the column sort response/field name sort response property and NOT the specifying return sort order property) but still pass back the response information to the RPG program so it can perform any task where that information would be useful.
Regards,
Marc Passmoor
Revolos