("echo");
+
+ // Echo back from input-box to /feels page.
+ echo.value = feels.value + String(" and a bold world!");
+ return String("");
+}
+
+void setup() {
+ delay(1000);
+ portal.load(addonJson); // Load custom Web pages
+ portal.on("/feels", feelsOn, AC_EXIT_AHEAD); // Register /feels handler
+ portal.begin();
+}
+
+void loop() {
+ portal.handleClient();
+}
+```
+
+The above example handles in the handler for the values of a custom web page. An [AutoConnect::on](api.md#on) function registers a handler for the AutoConnectAux page of the specified uri and can also specify when the handler is called. The argument of the custom Web page handler is an AutoConnectAux of the page itself and the [PageArgument](https://github.com/Hieromon/PageBuilder#arguments-of-invoked-user-function) object.
+
+To retrieve the values entered in a custom Web page you need to access the AutoConnectElement of the page that caused the request to this page and to do this, you use the [AutoConnect::where](api.md#where) function. The `AutoConnect::where` function returns a pointer to the AutoConnectAux object of the custom Web page that caused the HTTP request.
+
+!!! note "The where() function is available for only AutoConnectAux."
+ The `AutoConnect::where` function is available only for the AutoConnectAux object. It is invalid for HTTP requests from individual pages registered with the **on** handler of ESP8266WebServer/ESP32. In other words, the `AutoConnect::where` function only returns the last AutoConnecAux page called.
### When setting the initial values
-### How you can reach the valuess
+The `AutoConnect::on` function has a parameter indicating the timing to call a custom Web page handler.
+
+### How you can reach the values
+
+AutoConnectSubmit uses the POST method to send HTTP requests. A value of AutoConnectInput sent to the ESP8266 or ESP32 with POST is stored in the request body of the HTTP request:
+
+POST /feels HTTP/1.1
+Host: ESP8266_IP_ADDRESS
+name1=value1&name2=value2&name3=value3
+
+The query string included in the HTTP request body is parsed by ESP8266WebServer class and retrieved it using the `ESP8266WebServer::arg` function in the handler with sketch side. Its argument specifies the name of the input element.
WebServer.args, PageArgument
Handling in 'on' handler
## Transitions of the custom Web pages
+
+A handler registered with ESP8266Server::on can not coexist with AutoConnectAux::on.
diff --git a/mkdocs/api.md b/mkdocs/api.md
index 4a7db47..b200313 100644
--- a/mkdocs/api.md
+++ b/mkdocs/api.md
@@ -273,3 +273,14 @@ Register the handler function for undefined URL request detected.
**Parameters**
fnA function of the "not found" handler.
+
+### where
+```cpp
+AutoConenctAux* where(void)
+```
+Returns a pointer to the AutoConnectAux object of the custom web page that caused the request to that page. This function is available only for the AutoConnectAux object. It is invalid for HTTP requests from individual pages registered with the **on** handler of ESP8266WebServer/ESP32. In other words, this function only returns the last AutoConnecAux page called.
+
+
+ - **Retuen value**
+ - A pointer to the AutoConnectAux that caused the request the page.
+
diff --git a/mkdocs/images/ac_param_flow.svg b/mkdocs/images/ac_param_flow.svg
index 62490cf..3f6bc8a 100644
--- a/mkdocs/images/ac_param_flow.svg
+++ b/mkdocs/images/ac_param_flow.svg
@@ -10,9 +10,9 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="860.63983"
- height="459.59912"
- viewBox="0 0 227.71096 121.60225"
+ width="832.03271"
+ height="436.492"
+ viewBox="0 0 220.14199 115.4885"
version="1.1"
id="svg1212"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
@@ -213,16 +213,16 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
- inkscape:cx="512.21056"
- inkscape:cy="211.19727"
+ inkscape:cx="343.2971"
+ inkscape:cy="197.13344"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:snap-global="false"
inkscape:window-width="1616"
inkscape:window-height="851"
- inkscape:window-x="1346"
- inkscape:window-y="66"
+ inkscape:window-x="1667"
+ inkscape:window-y="103"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
@@ -245,12 +245,24 @@
inkscape:label="レイヤー 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(-47.611264,-75.652706)">
+ transform="translate(-54.981799,-75.851144)">
+
+
+ transform="translate(18.421829,-13.844294)">
+ transform="matrix(0.05237375,0,0,0.04755636,54.981799,95.989516)"
+ style="stroke-width:1.17960072">
+ style="stroke-width:1.17960072">
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ style="stroke-width:1.17960072" />
+ transform="translate(-61.780506,-30.859554)">
Web Browser
- ESP8266WebServerWebServer w/ESP32
- POST /{URL}Input=Value...
Value
- AutoConnect
- Sketch
REGISTER
- AutoConnectAux
()
}
-
-
+
+
+ Sketch
+
+
+
+ AutoConnectAux
+
+
+
+ AutoConnect
+
+
+
+ ESP8266WebServerWebServer w/ESP32
+
+ POST /{URL}Input=Value...