Page 1 of 1

Dynamically Populate dropdowns

Posted: 09 Sep 2019, 19:39
by Eugene.King
I have a grid of data on a screen which behaves like a subfile, with options across the top and a select column. This data grid doesn't contain any of the standard subfile markers so aXes cannot render it automatically as it does with subfiles. Does anyone have any ideas on how I can get the options from across the top of the screen and use them to dynamically populate a dropdown against each row of data? For added complication these options will change base on user authorities.

Thanks in advance for any assistance.
Best regards,
Eugene

Re: Dynamically Populate dropdowns

Posted: 10 Sep 2019, 19:57
by Fairdinkum
Hi Eugene,

We (Fairdinkum) have not experienced it yet. I am currently working on this, but I have not yet realized...

Best Regards,
Hidekazu Tanaka

Re: Dynamically Populate dropdowns

Posted: 11 Sep 2019, 15:08
by Fairdinkum
Hello,

By adding the rules to "AutoGUI+", we were able to get the results.
RESULT01.png
RESULT01.png (48.91 KiB) Viewed 183 times
There are 3 prerequisites.
(1) The value of options can be get using script.
(2) The options' string can be split for drop-down with a delimiter.
(3) Fields of "Selection column" (target) can be set to "Identification rule" of "AutoGUI +".

Setting examples are as follows.

Name of rule is "dropdown" and apply as dropdown
rule01.png
rule01.png (722.97 KiB) Viewed 183 times
Identification Rules
rule02.png
rule02.png (16.29 KiB) Viewed 183 times
Properties
rule03.png
rule03.png (159.66 KiB) Viewed 183 times
script of fixedValues property

==========================================
var fld = FIELDS("Option_F");
var oOptions = fld.getValue();
// alert("oOptions= "+oOptions);
var aOptions = oOptions.split(",");

var ret = [];
var idx = 0;
ret[idx]= {value: "", text: "-- Select --"};
idx++;

aOptions.forEach(
function(entry) {
var val = entry.split("=");
ret[idx]= {value: val[0].trim(), text: val[1]};
idx++;
}
);

console.log("ret="+ret);

/*
var ret = [
{value:1,text:"OPT1"},
{value:2,text:"OPT2"}
];
*/
ENV.returnValue = ret;
==========================================

Best Regards,
Jun Kato