Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the state of a checkbox in a Simple Form uib-element? #221

Closed
TotallyInformation opened this issue Jul 4, 2023 Discussed in #219 · 2 comments
Closed

How to get the state of a checkbox in a Simple Form uib-element? #221

TotallyInformation opened this issue Jul 4, 2023 Discussed in #219 · 2 comments
Assignees
Labels
bug It's life Jim but not as we know it! Fixed Phew, think I got away with it.

Comments

@TotallyInformation
Copy link
Owner

Discussed in #219

Originally posted by shanedmurphy June 15, 2023
Before I jump in and open an issue I just want to check if I am missing something...

I want to use a checkbox in a form to control enable/disable of a feature. I read the state from its source, then generate the form using a function node (content is dynamic) and pass it to the uib-element node configured as a simple form. I can render the state correctly by including a checked property for the checkbox if it should be checked, and removing it if it should not be checked. But when a button is pressed and I get an event in node-red with the state of the other form fields, I can't see anything in the event which tells me the state of the checkbox. The value property at the top level seems irrelevant for a checkbox and there is no checked property. I note if the checkbox has been interacted with I get something in the _ui.form.{checkboxId}.data but this doesn't tell me the final state of the checkbox.

I can create an issue if this is a bug, and possibly try to contribute a solution depending if this doesn't involve anything too invasive. But I am also not 100% confident I am not just missing something here...

@TotallyInformation TotallyInformation self-assigned this Jul 4, 2023
@TotallyInformation TotallyInformation added bug It's life Jim but not as we know it! Fixed Phew, think I got away with it. labels Jul 4, 2023
@TotallyInformation
Copy link
Owner Author

Bug stemming from the fact that checkbox inputs are the only input that does not use the value attribute! Go figure!!

Fixed in v6.5.0 or v7.0.0 which ever comes first.

@TotallyInformation
Copy link
Owner Author

Fixed in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's life Jim but not as we know it! Fixed Phew, think I got away with it.
Projects
None yet
Development

No branches or pull requests

1 participant