Set the style of dynamically generated radio buttons

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

Set the style of dynamically generated radio buttons

Post by Eugene.King » 10 Sep 2019, 01:42

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

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

Re: Set the style of dynamically generated radio buttons

Post by Fairdinkum » 10 Sep 2019, 17:01

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 113 times
img_20190910_155842_001.png
img_20190910_155842_001.png (17.17 KiB) Viewed 113 times
Best Regards,
Hidekazu Tanaka

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

Re: Set the style of dynamically generated radio buttons

Post by Fairdinkum » 10 Sep 2019, 18:55

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 106 times
The expected result is here:
img_20190910_175444_001.png
img_20190910_175444_001.png (9.63 KiB) Viewed 106 times
HTH.


Best Regards,
Hidekazu Tanaka

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

Re: Set the style of dynamically generated radio buttons

Post by Eugene.King » 10 Sep 2019, 20:11

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
Attachments
Radio_Button_Properties.png
Radio_Button_Properties.png (185.2 KiB) Viewed 103 times

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

Re: Set the style of dynamically generated radio buttons

Post by Fairdinkum » 10 Sep 2019, 20:55

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

Post Reply