Closed Laxilef closed 5 months ago
I'm lost. Can you explain the example a bit? You're setting the default to "T" and making getValue always return "T", but then only calling base getValue(). How does this create a dynamic checkbox?
For a checkbox the value must always be filled (1/yes/true/T). State of the checkbox is the attribute "checked". Therefore, we override the getValue method that is used to generate the form: https://github.com/tzapu/WiFiManager/blob/f328cd05cd5aa758b414d8e6961e21a1f6370cab/WiFiManager.cpp#L1777C9-L1777C81
And we get the real value using getCheckboxValue. Then you can change the value and the checkbox in the form will be checked or unchecked.
Yes, this is not the most beautiful method. But I couldn't find another one :(
I thought this was already addressed. Thanks will take a look
I thought this was already addressed. Thanks will take a look
What do you think about it? :) So far I have to use a fork in my open source projects.
Hi Currently there is no way to create a dynamic checkbox. I wrote the code for this:
But for it to work, getValue must be overridden.
https://github.com/tzapu/WiFiManager/issues/1654 https://github.com/tzapu/WiFiManager/issues/1639 https://github.com/tzapu/WiFiManager/issues/1111