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
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":
Can't seem to use FIELDS to find a default visualization input field
Moderator: jeanmichel
Can't seem to use FIELDS to find a default visualization input field
- Attachments
-
- Screenshot_axes_example_02.gif (15.85 KiB) Viewed 13005 times
Re: Can't seem to use FIELDS to find a default visualization input field
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: .
Then both fields are set to "foo".
Clicking the button again gives me the correct alert:
I tried the same as you did (and copied your code).
First time I get an "empty" alert: .
Then both fields are set to "foo".
Clicking the button again gives me the correct alert: