Dynamically Populate dropdowns

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
Eugene.King
Posts: 4
Joined: 09 Sep 2019, 19:26

Dynamically Populate dropdowns

Post by Eugene.King » 09 Sep 2019, 19:39

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

Fairdinkum
Posts: 42
Joined: 24 Jul 2017, 17:02

Re: Dynamically Populate dropdowns

Post by Fairdinkum » 10 Sep 2019, 19:57

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

Fairdinkum
Posts: 42
Joined: 24 Jul 2017, 17:02

Re: Dynamically Populate dropdowns

Post by Fairdinkum » 11 Sep 2019, 15:08

Hello,

By adding the rules to "AutoGUI+", we were able to get the results.
RESULT01.png
RESULT01.png (48.91 KiB) Viewed 35 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 35 times
Identification Rules
rule02.png
rule02.png (16.29 KiB) Viewed 35 times
Properties
rule03.png
rule03.png (159.66 KiB) Viewed 35 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

Post Reply