mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-28 09:35:49 +03:00
[GH-ISSUE #1738] How to refresh (repaint) custom param element on setValue() #1476
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#1476
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 @jpeterse on GitHub (May 15, 2024).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1738
I'm working on an project, where I would like to give users feedback when entering custom parameters in the config panel.
I have it sending value updates to a param element using setValue(). But it doesn't look like the element is refreshed on the page until the entire page is refreshed. E.g. like in issue 1464 about logging.
I would like for users not to loose their data input, in order to refresh that one field that the code is updating.
Is there a way, that the field can be redrawn/refreshed when setValue() is called?
(BTW, I'm aware setValue() is server side, and I need to update the field client side. Question is, how I can do that.)
Generic Esp8266
Core Version: 2.0.17
Sample code;
@tablatronix commented on GitHub (May 15, 2024):
Are you wanting to do it via ajax? Not sure I understand, you will need to add some xhr js to the page
@jpeterse commented on GitHub (May 16, 2024):
I assume it would have to be done with ajax. But that's only my assumption.
I have not been able to find examples of how I can use that abilities provided within WiFiManager, to update a field on the configuration page dynamically. Users will have to click the refresh button to reload the configuration page to see the updated value.
WiFiManager starts it own web server, when the configuration page is being displayed. I know I can inject java script in the header, and on custom parameters as well. But I don't know if I have access to inject the js code needed to listen for XHR requests.
I was looking to use WiFiManager to do this, because it's a one time configuration, just like setting up the network is.
But Is it possible, or is a fools errand to attempt to use custom parameters for this? ;-)