@ -99,6 +99,8 @@ You can put declarations of multiple custom Web pages in one JSON document. In t
]
```
The above custom Web page definitions can be loaded in a batch using the [AutoConnect::load](api.md#load) function.
### <iclass="fa fa-caret-right"></i> JSON object for AutoConnectElements
JSON description for AutoConnectElements describes as an array in the *element* with arguments of [each constructor](acelements.md#constructor).
@ -171,7 +173,7 @@ This is different for each AutoConnectElements, and the key that can be specifie
: - **option** : Specifies the initial value collection of the drop-down list as an array element.
#### <iclass="fa fa-caret-right"></i> ACStyle
: - **value** : Specifies the cuscom CSS code.
: - **value** : Specifies the custom CSS code.
#### <iclass="fa fa-caret-right"></i> ACSubmit
: - **value** : Specifies a label of the submit button.
@ -187,6 +189,102 @@ This is different for each AutoConnectElements, and the key that can be specifie
## Loading JSON document
### <iclass="fa fa-caret-right"></i> Loading to AutoConnect
There are two main ways to load the custom Web pages into AutoConnect.
1. Load directly into AutoConnect
This way does not require an explicit declaration of AutoConnectAux objects with sketches and is also useful when importing the custom Web pages JSON document from an external file such as SPIFFS because the page definition and sketch coding structure can be separated.
Using the [AutoCoonnect::load](api.md#load) function, AutoConnect dynamically generates the necessary AutoConnectAux objects internally based on the custom Web page definition of the imported JSON document content. In the sketch, the generated AutoConnectAux object can be referenced using the [AutoConnect::aux](api.md#aux) function. You can reach the AutoConnectElements you desired using the [AutoConnectAux::getElement](apiaux.md#getelement) function of its AutoConnectAux.
In the following example, it loads in a batch a JSON document of custom Web pages stored in SPIFFS and accesses to the AutoConnectInput element.
This way declares AutoConnectAux in the sketch and loads the custom Web pages JSON document there. It has an advantage for if you want to define each page of a custom Web page individually or allocate AutoConnectAux objects dynamically on the sketch side.
After loading a JSON document using the [AutoConnectAux::load](apiaux.md#load) function by each, integrate those into AutoConnect using the [AutoConnect::join](api.md#join) function.
In the following example, you can see the difference between two sketches in a sketch modified using the AutoConnectAux::load.