mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 17:15:53 +03:00
[GH-ISSUE #1030] Cannot change the html of a custom parameter #878
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#878
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GiPe66 on GitHub (Apr 6, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1030
Hi all,
I did not find any way to change the html of a custom parameter.
It is possible to get the html code of a custom parameter (getCustomHTML) but not to change it when it has been created.
I added a simple method to set it.
This allows changing a select /option in my case but also will help changing the radio button checked or any configurable html input in a non blocking mode web portal.
Thanks for your attention.
@dontsovcmc commented on GitHub (May 18, 2020):
@GiPe66 please, see here: https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp#L15
or here:
https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp#L28
there are some examples of using: https://github.com/dontsovcmc/waterius/blob/master/ESP8266/src/setup_ap.cpp#L113
@tablatronix commented on GitHub (May 18, 2020):
Also check out the /development branch childparamsclass example, it shows how to create custom params
https://github.com/tzapu/WiFiManager/blob/development/examples/ParamsChildClass/ParamsChildClass.ino
@TheNetStriker commented on GitHub (Jun 3, 2020):
I'm having the same problem. I've added a custom checkbox parameter, but I want to add the "checked" html attribute dynamically after the WiFiManagerParameter is initialized depending on the stored settings. The examples above only show how the custom html can be set when initializing the WiFiManagerParameter. Is there a way to change this after initialization or could this setter be implemented?
@tablatronix commented on GitHub (Jun 3, 2020):
you can use param.setValue and change it at anytime via the param reference
@tablatronix commented on GitHub (Jun 3, 2020):
see the dev example
There is no param callback atm so you might have to figure out when some other way
@TheNetStriker commented on GitHub (Jun 3, 2020):
@tablatronix I've already tried this, but this seem to only change the value of my custom parameter. The checkbox on the web page is still not checked when it is loaded. As a workarround I'm now initializing the custom WiFiManagerParameter in the setup() method after reading the json settings and set the checked attribute if needed:
custom_setting = new WiFiManagerParameter("id", "description", "value", 6, setting_enabled ? "type="checkbox" checked" : "type="checkbox"");
@tablatronix commented on GitHub (Jun 3, 2020):
Ill have to check but you should be able to just override or add your own methods to change the custom html. I thought someone already made a checkbox example somewhere. But its not in the example