Commit 2d6a074d authored by Carsten  Rose's avatar Carsten Rose
Browse files

UsersManual/index.rst: renamed chapter for formelements. Cleanup formelement...

UsersManual/index.rst: renamed chapter for formelements. Cleanup formelement types. Wrote chapter 'Detailed concept'
parent 325d7e0d
......@@ -522,8 +522,8 @@ Form: main
|created | datetime | set once through QFQ |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
Field: Form.showButton
^^^^^^^^^^^^^^^^^^^^^^
showButton
^^^^^^^^^^
Display or hide the button `new`, `delete`, `close`, `save`.
......@@ -536,8 +536,8 @@ Display or hide the button `new`, `delete`, `close`, `save`.
.. _form-parameter:
Field: Form.parameter
^^^^^^^^^^^^^^^^^^^^^
parameter
^^^^^^^^^
* The following parameter are optional and can be configured in the *Form.parameter* field.
......@@ -561,8 +561,8 @@ Field: Form.parameter
* class = container-fluid
* classBody = qfq-form-right
Field: Form.parameter.submitButtonText
''''''''''''''''''''''''''''''''''''''
submitButtonText
''''''''''''''''
* Optional.
* Default: Empty
......@@ -570,8 +570,8 @@ Field: Form.parameter.submitButtonText
* Non Empty: a 'submit' button, with <submitButtonText>, is rendered at the bottom of the form (without a 'check' glyph
symbol). Typically 'ShowButton: Save' will be unchecked to hide the regular save glyph symbol.
Field: Form.parameter.class
'''''''''''''''''''''''''''
class
'''''
* Optional.
* Default: `container`
......@@ -581,8 +581,8 @@ Field: Form.parameter.class
* See: http://getbootstrap.com/css/#overview-container
* Expand the form over the whole area: `container-fluid`
Field: Form.parameter.classPill
'''''''''''''''''''''''''''''''
classPill
'''''''''
* Optional.
* Default: `qfq-color-grey-1`
......@@ -593,8 +593,8 @@ Field: Form.parameter.classPill
`qfq-color-blue-1` (dark), `qfq-color-blue-2`. (light)
* `classPill` is only visible on forms with container elemants of type 'Pill'.
Field: Form.parameter.classBody
'''''''''''''''''''''''''''''''
classBody
'''''''''
* Optional.
* Default: `qfq-color-grey-2`
......@@ -926,6 +926,11 @@ Type: editor
Type: note
^^^^^^^^^^
Type: password
^^^^^^^^^^^^^^
* Like a `text` element, but every character is shown as a asterisk.
Type: radio
^^^^^^^^^^^
......@@ -1057,15 +1062,6 @@ will be rendered inside the form as a HTML table.
* *Constant '&'*: Indicate a 'constant' value. E.g. `&12:xId` or `{{...}}` (all possibilities, incl. further SELECT
statements) might be used.
Type: string
^^^^^^^^^^^^
Type: submit
^^^^^^^^^^^^
Typically not used. Useful if user wishes an explicit 'Submit' Button.
Type: time
^^^^^^^^^^
......@@ -1143,8 +1139,8 @@ Types:
* Check data
Perform checks by fireing s SQL query and expecting a predefined number of selected records. Depending on the
'action'-type, the check is perform on form load, or form save.
Perform checks by fireing a SQL query and expecting a predefined number of selected records. Depending on the
'action'-type, the check is perform on form load or form save.
* OK: the expected number of records has been selected. Continue processing the next FormElement.
* Fail: the expected number of records has not been selected (less or more): Display an error message and abort the
......@@ -1190,6 +1186,40 @@ Types:
* If the `action`-FormElement name exist as a column in the master record: Update that column with the recent slaveId
(after an INSERT the last_insert_id() acts as the new `slaveId`).
Detailed concept
''''''''''''''''
Complex forms often needs to create additional records or have to update existing records, depending on the master record
(existing or newly created). With the help of the following such situations are solved.
* 'slaveId'
* name the action formelement equal to the real columnname. {{slaveId}} will represent the content of 'master.<name of action formelement>'
* explicitly define the 'slaveId' via {{SELECT ...}} or any other variable or constant.
* 'sqlInsert', 'sqlUpdate', 'sqlDelete'
Situation 1: master.x_id=slave.id (1:1)
* Name the action element 'x_id': than {{slaveId}} will be automatically set to the value of 'master.x_id'
* {{slaveId}} == 0 ? 'sqlInsert' will be fired.
* {{slaveId}} != 0 ? 'sqlUpdate' will be fired.
* In case of fireing 'sqlInsert', the 'slave.id' of the new created record are copied to master.x_id (the database will
be updated automatically).
* If the automatic update of the master record is not suitable, the action element should have no name or a name
which does not exist as a column of the master record. Define `slaveId={{SELECT id ...}}`
Situation 2: master.id=slave.x_id (1:n)
* Name the action element different to any columnname of the master record (or no name).
* Determine the slaveId: `slaveId={{SELECT id FROM slave WHERE slave.xxx={{...}} LIMIT 1}}`
* {{slaveId}} == 0 ? 'sqlInsert' will be fired.
* {{slaveId}} != 0 ? 'sqlUpdate' will be fired.
Type: sendmail
......
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