I want the user to select only one item using the following e.g.
Names Default To Here( 1 );
New Window( "Example",
cb = Check Box(
{"Max", "Median", "Min", "Mean", "Std Dev"},
returned = (cb << Get Selected ())[1];
Print( returned ) //{"Mean", "Std Dev"} or etc
)
);
The above works, but if the user checks and then unchecks the checked box, JMP throws an error as it can no longer execute
returned = (cb << Get Selected ())[1];
How to handle this by perhaps showing a dialog to the user saying that "user must select only option to proceed"?
Also, is it possible to start with a check box already checked? If so, how?
If you want user to select only one option, use radio box or combo box instead of check box.
If you want to use check box, remove the index and add check for length of the list
Names Default To Here( 1 );
New Window( "Example",
cb = Check Box(
{"Max", "Median", "Min", "Mean", "Std Dev"},
returned = (cb << Get Selected ());
If(N Items(returned) >= 1,
show(returned);
show(returned[1]);
);
)
);