Page 1 of 1

Set the style of dynamically generated radio buttons

Posted: 10 Sep 2019, 01:42
by Eugene.King
With the assistance of Support I have setup an global Auto-GUI rule to dynamically create radio buttons based on the text displayed on the screen after the input field. For example after an input field I have the following text
1=Option 1, 2=Option 2, 3=Option 3
The script below converts them to a set of radio buttons with the text Option 1, Option 2 and Option 3.

var fld = FIELD.nextField();
var oOptions = fld.getValue();
var aOptions = oOptions.split(",");
var ret = [];
var idx = 0;
aOptions.forEach(function(entry) {
var val = entry.split("=");
ret[idx]= {value: val[0].trim(), text: val[1]};
idx++;
}
);
ENV.returnValue = ret;

I now want to set the colour of the text to blue. I tried using the style option in the Auto GUI but this has no effect. I tried changing the JavaScript to use the font color intrinsic.

ret[idx]= {value: val[0].trim(), text: val[1].fontcolor("blue")};

Rather than the font color changing I get the HTML tags displayed.

<font color="blue">PDD</Font>

Has anyone had any experience changing the style of dynamically created controls?
Thanks in advance.
Best Regards,
Eugene

Re: Set the style of dynamically generated radio buttons

Posted: 10 Sep 2019, 17:01
by Fairdinkum
Hi Eugene,

Did you try to use "captionStyle"? This style affects to caption of the radio button.
img_20190910_155757_001.png
img_20190910_155757_001.png (49.15 KiB) Viewed 114 times
img_20190910_155842_001.png
img_20190910_155842_001.png (17.17 KiB) Viewed 114 times
Best Regards,
Hidekazu Tanaka

Re: Set the style of dynamically generated radio buttons

Posted: 10 Sep 2019, 18:55
by Fairdinkum
Hi Eugene,

The screen shot should be something like below in v4.2.0.
img_20190910_175233_001.png
img_20190910_175233_001.png (72.23 KiB) Viewed 107 times
The expected result is here:
img_20190910_175444_001.png
img_20190910_175444_001.png (9.63 KiB) Viewed 107 times
HTH.


Best Regards,
Hidekazu Tanaka

Re: Set the style of dynamically generated radio buttons

Posted: 10 Sep 2019, 20:11
by Eugene.King
Hi Hidekazu,
I don't seem to have the option for the caption style in the extension properties (see attached image Radio Button Properties).
I'm using aXes 4.2. I'm also using an AutoGUI rule to create the radio buttons. I would like to set the style on the rule rather than on every screen.
Best Regards,
Eugene

Re: Set the style of dynamically generated radio buttons

Posted: 10 Sep 2019, 20:55
by Fairdinkum
Hello Eugene,

You are selecting "Material Design" from Application->Styling->appStylesTheme property, I think.
"captionStyle" is the property for Basic and JQueryUI theme only.

Best Regards,
Jun Kato