Page 1 of 1

Setting Checkbox 'Checked value'

Posted: Mon Jul 09, 2018 4:54 pm
by BudaM
I'll start by saying I have very limited knowledge of Profound and JS.

I have converted a widget from an output field to an hyperlink.
I'd like to set the 'checked value' of a checkbox widget, based on the 'onclick' function of the hyperlink.
How do I do it ?
Here is what I tried:
pui.set(I_2_2,"1");
pressKey("Enter");


Thanks

Max

Re: Setting Checkbox 'Checked value'

Posted: Mon Jul 09, 2018 5:17 pm
by Scott Klement
A checkbox has properties called "checked value" and "unchecked value" that control the value that is inserted in the underlying 5250 screen and sent back to your application. For example, a lot of 5250 applications had fields where you might type Y for Yes, or N for No. If you used Genie to change that into a checkbox, you'd set the "checked value" to Y, and "unchecked value" to "N", so that the underlying program would still get the original values.

When you want to set it programmatically, you'd also use those values with the pui.set() API.

Also when calling pui.set() the "id"parameter should be in quotes. So your code would look something like this:

Code: Select all

pui.set("I_2_2","Y");
pressKey("Enter");
That's assuming that your checked value is Y (which it may not be, I'm not familiar with your application) and that you also want to press Enter automatically after checking the field.

Hope that helps

Re: Setting Checkbox 'Checked value'

Posted: Tue Jul 10, 2018 8:35 am
by BudaM
It makes sense.
I was just missing the quotes around the ID parameter.


Thanks Scott.