Commit 3b2001ef authored by Carsten  Rose's avatar Carsten Rose
Browse files

UsersManual/index.rst: Additional sanitize classes documented. Dynamic Update

parent c6250c1e
......@@ -97,7 +97,7 @@ Debug
Form
----
* Forms will be created by using the *Form editor*. The Formeditor itself consist of two regular QFQ forms: *form* and *formElement*
* Forms will be created by using the *Form editor* (HTML form). The Formeditor itself consist of two regular QFQ forms: *form* and *formElement*
* Every form consist of a) a *Form* record and b) multiple *FormElement* records.
* A form is assigned to a *table*. Such a table is called the *primary table* for this form.
* There are three types of forms:
......@@ -139,15 +139,16 @@ Most fields of a form specification might contain:
*{{SELECT name FROM person WHERE id={{recordid}} }}*
*{{SELECT name FROM person WHERE id={{key1:C:ALNUMX}} }}*
*{{SELECT name FROM person WHERE id={{key1:C:alnumx}} }}*
* Leading and trailing spaces inside curly braces are removed.
* *{{ SELECT "Hello World" }}* acts as *{{SELECT "Hello World"}}*
* *{{ varname }}* acts as *{{varname}}*
* There are several stores, from where to retrieve the value. If a value is not found in one store, the next store is searched, and so on,
until a value is found.
* There are several stores, from where to retrieve the value. If a value is not found in one store, the next store is searched,
until a value is found or there are no more stores available.
* sdkf
* If anywhere along the line an empty string is found, this **is** a value: therefore, the search will stop.
* If no value is found, the value is an <empty string>.
......@@ -155,21 +156,26 @@ URL Parameter
-------------
* URL (=GET) Parameter can be used in *forms* and *reports* as variables.
* If a value a parameter sanitize class, an exception is thrown.
* If a value violates a parameter sanitize class, an exception is thrown.
Sanitize class
--------------
* All values in Store *C* (Client) and store *F* (Form) will be sanitized with one of three classes:
* All values in Store *C* (Client) and store *F* (Form) will be sanitized:
* All :ref:`predefined-variable-names` have a specific default sanitize class. For these variables, it's not necessary
to specify a sanitize class.
* All other variables (Store: C, F) get by default the sanitize class defined in the corresponding form. If not defined
the default class is 'digit'.
* A default sanitize class can be overwritten by individual definition: *{{a:C:all}}*
* **alnumx**: [A-Za-z][0-9]@-_.,;: /()
* **digit**: [0-9].-+
* **alnumx**: [A-Za-z][0-9]@-_.,; /()
* **email**: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
* **min|max**: only usable in forms. Compares the value against an lower and upper limit (numeric or string).
* **min|max date**: only usable in forms. Compares the value against an lower and upper date or datetime.
* **pattern**: only usable in forms. Compares the value against a regexp.
* **all**: no sanitizing
* All :ref:`predefined-variable-names` have a specific default sanitize class. For these variables, it's not necessary
to specify a sanitize class.
* All other variables (Store: C, F) get by default the sanitize class 'digit'.
* A default sanitize class can be overwritten by individual definition: *{{a:C:all}}*
Store / prio
------------
......@@ -286,6 +292,7 @@ Store: *FORM* - F
* Formelements who will be rerendered, after a parent element has been changed by the user.
* Formelement actions, before saving the form.
* Values will be sanatized by the class configured in corresponding the formelement. By default, the sanitize class is `alnumx`.
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation |
......@@ -418,17 +425,19 @@ FormElements
* Each *form* contains one or more *FormElement*.
* The *FormElements* are divided in three categories:
* *native*
* *container*
* *action*
* :ref:`class-container`
* :ref:`class-native`
* :ref:`class-action`
* Ordering and grouping: Native Form-Elements and Container-Elements (both with feIdContainer=0) will be ordered by 'ord'.
* Inside of a container, all nested elements will be displayed.
.. _class-container:
Class: Container
----------------
* Pills are containers for 'fieldset' and 'native' Form-Elements.
* Pills are containers for 'fieldset' *and* 'native' Form-Elements.
* Fieldsets are containers for 'native' Form-Elements
Type: fieldset
......@@ -454,6 +463,8 @@ Type: pill
* FormElement.'''feIdContainer''': 0 # Pill's can't be nested.
* Form.'''Parameter''': *maxVisiblePill=<nr>* Number of Pill-Buttons shown. Undefined means unlimited. Excess Pill buttons will be displayed as a dropdown menu.
.. _class-native:
Class: Native
-------------
......@@ -469,6 +480,7 @@ Class: Native
|enabled | enum('yes'|'no') | |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|dynamicUpdate | enum('yes'|'no') | In the browser, formelements with "dynamicUpdate='yes'" will be updated depending on user input. |
| | | :ref:`dynamic-update` |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|name | string | |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
......@@ -616,10 +628,6 @@ Class: Native
* 2: Any number >1 makes the 'select' input 'multiple' ready.
* See: https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)
Class: native
^^^^^^^^^^^^^
* All 'native' Formelements like 'input', 'checkbox', ...
Type: checkbox
......@@ -792,6 +800,8 @@ Type: upload
* See: https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)
* parameter:accept: *image/*,video/*,audio/*,.doc,.docx,.pdf,<mime type>*
.. _class-action:
Class: Action
-------------
......@@ -852,6 +862,22 @@ Type: sendmail
* Send mail(s) on request.
* respects 'processRow'
.. _dynamic-update:
Dynamic Update
--------------
Depending of the form requirements, it's necessary to update FormElements depending on the recent user input. E.g. a user
activates a checkbox and therefore the content of a select list should change.
Make a form dynamic:
* Mark all FormElements with {dynamic update}=enabled, which should send **or** receive a 'do update' signal.
* Define the receiving FormElements in a way, that they will interpret the recent user change. In the example, the FormElement
'carPriceRange' is the sender and the receiving FormElement might be of type 'radio' or 'selectList'.
[receiving formElement].parameter: itemList={{ SELECT IF({{carPriceRange}}='expensive','Ferrari,Tesla,Jaguar','General Motors,Honda,Seat,Fiat') }}
Report
======
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment