Can't seem to use FIELDS to find a default visualization input field

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
gracehsu
Posts: 8
Joined: 23 Dec 2022, 04:06

Can't seem to use FIELDS to find a default visualization input field

Post by gracehsu » 18 Nov 2023, 05:56

I can't seem to get FIELDS() to work consistently with a default visualization I added to a screen.

Example below is a test I set up just to see what I'm doing wrong :
1. I named the command line for the menu to "cmd_Line".
2. I added a default Visualization I called "io_Test"
- note: I copy-pasted this name in the script to make sure I'm not fatfingering
Screenshot_axes_example_01.gif
Screenshot_axes_example_01.gif (209.54 KiB) Viewed 13005 times
3. I added a button into which I put the following script onClick:
alert("io_Test=" +FIELDS("io_Test").getValue()+'\n' +'cmd_Line: '+FIELDS("cmd_Line").getValue());
FIELDS("io_Test").setValue("foo");
FIELDS("cmd_Line").setValue("foo");
4. Tests:
a. click button with both fields blank, both io_Test & cmd_Line were correctly filled with the text "foo"
b. fill io_Test with "default value" & cmd_Line with "something I typed":
The attachment Screenshot_axes_example_02.gif is no longer available
Attachments
Screenshot_axes_example_02.gif
Screenshot_axes_example_02.gif (15.85 KiB) Viewed 13005 times

Fre_Vdh
Posts: 30
Joined: 20 Oct 2022, 17:49

Re: Can't seem to use FIELDS to find a default visualization input field

Post by Fre_Vdh » 22 Nov 2023, 00:57

Are you sure that the name of the command line field is "cmd_Line"?

I tried the same as you did (and copied your code).

First time I get an "empty" alert:
1.png
1.png (64.89 KiB) Viewed 12991 times
.

Then both fields are set to "foo".
Clicking the button again gives me the correct alert:
2.png
2.png (59.56 KiB) Viewed 12991 times

Post Reply