Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Checkbox to set global HK
-
- Posts: 64
- Joined: Sun Jan 22, 2023 7:03 pm
Checkbox to set global HK
Hi,
I am trying to set a global hash cookie upon ticking an input/checkbox object on a browse form.
It works perfectly with input/text objects using onBlur event, but not with the input/checkbox.
I tried all events without success.
Where am I wrong?
Thanks
I am trying to set a global hash cookie upon ticking an input/checkbox object on a browse form.
It works perfectly with input/text objects using onBlur event, but not with the input/checkbox.
I tried all events without success.
Where am I wrong?
Thanks
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
-
- Posts: 64
- Joined: Sun Jan 22, 2023 7:03 pm
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Checkbox to set global HK
checkbox_inq_tutti.value always returns on
You could retrieve the checkbox value with
(returns 'true' or 'false')
You could retrieve the checkbox value with
Code: Select all
nuGetValue('checkbox_inq_tutti').toString()
-
- Posts: 64
- Joined: Sun Jan 22, 2023 7:03 pm
-
- Posts: 64
- Joined: Sun Jan 22, 2023 7:03 pm
Re: Checkbox to set global HK
Is there a place in the nuBuilder documentation where I can find this kind of info? e.g. objects, properties, methods, etc?
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Checkbox to set global HK
This has been reported as "bug" here.
https://github.com/smalos/nuBuilder4-Bu ... boolean.md
But this is probably not a bug, but rather a limitation of the function. The nuSetProperty function is designed to work with strings, so when you pass a boolean value directly to the function, it will not work as expected.
I'll make sure to add a note to the nuBuilder wiki documentation about this limitation of nuSetProperty and the need to convert boolean values to strings before passing them to the function. This will help other users who encounter the same issue in the future. Thank you for bringing it to our attention!
https://github.com/smalos/nuBuilder4-Bu ... boolean.md
But this is probably not a bug, but rather a limitation of the function. The nuSetProperty function is designed to work with strings, so when you pass a boolean value directly to the function, it will not work as expected.
I'll make sure to add a note to the nuBuilder wiki documentation about this limitation of nuSetProperty and the need to convert boolean values to strings before passing them to the function. This will help other users who encounter the same issue in the future. Thank you for bringing it to our attention!
-
- Posts: 64
- Joined: Sun Jan 22, 2023 7:03 pm
Re: Checkbox to set global HK
Thank you.
To complete the picture, the toString() method applied to my checkbox sometimes returns "0" instead of "true". I managed with an OR, but it's weird...
To complete the picture, the toString() method applied to my checkbox sometimes returns "0" instead of "true". I managed with an OR, but it's weird...
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Checkbox to set global HK
nuGetValue() should always return true or false when used with a checkbox. Isn't that the case?
-
- Posts: 64
- Joined: Sun Jan 22, 2023 7:03 pm
Re: Checkbox to set global HK
Hi kev1n, I made some tests with nuGetValue() and nuDebug(). I use checkboxes in nuuserhome to set global hashes and modify browse SQLs.
So, the issue is not with checkboxes, but with global HKs. They appear to be "1" or "0" in the first browse page, and "true" or "false" when I hit the bottom arrows to move to other pages.
So, the issue is not with checkboxes, but with global HKs. They appear to be "1" or "0" in the first browse page, and "true" or "false" when I hit the bottom arrows to move to other pages.