Wiki source code of Dynamische Elemente
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
![]() |
1.1 | 1 | {{content/}} |
| 2 | |||
| |
4.4 | 3 | In forms even dynamic elements can occur. These fields are duplicated during the input. A typical example here is the declaration of e.g. people living in one houshold. If you e.g. select //5//, the (% style="line-height:1.4em" %)respective block is displayed five times. Another example is the opporunity of any number of [[uploads>>doc:Formcycle.Designer.Form.FormElements.Upload]]. |
![]() |
1.1 | 4 | |
| |
4.4 | 5 | {{figure image="FCSnapshot0.png"}} |
| 6 | An application example for dynamic elements. The data of students are acquired, the number of students is at that variable. | ||
![]() |
1.1 | 7 | {{/figure}} |
| 8 | |||
| |
4.4 | 9 | Repeated elements are created directly in the {{designer/}} or by using the JavaScript function {{jsdoc page="jquery" name="dynamic"/}}. |
![]() |
1.1 | 10 | |
| |
4.4 | 11 | == Triage of dynamic elements == |
![]() |
1.1 | 12 | |
| |
4.4 | 13 | Within the possible actions, dynamic elements are treated as follows. |
![]() |
1.1 | 14 | |
| |
4.4 | 15 | If a dynamic element is used in the [[inbox>>doc:Formcycle.Inbox.WebHome]] or in the [[workflow>>doc:Formcycle.Designer.Workflow.WebHome]] later, all values of its dynamic elements, connected with a comma, are redelivered. By creating a new column in the inbox for the dynamic field with the name //tf1//, all values in the column in the inbox than appear comma seperated. |
![]() |
1.1 | 16 | |
| |
4.4 | 17 | In the form itself every duplicated element gets a name after the schema //Elementname_index//. So, if three pieces of the element //tf1// existed, the fields with the name //tf1_0//, //tf1_1// and //tf1_2// would be generated. To these fields it can also be accessed directly with this name in inboxes or in the action processing. |
![]() |
1.1 | 18 | |
| |
4.4 | 19 | To select all duplicated elements, it can be accessed with the attribute //org_name// instead of //name//. |
![]() |
1.1 | 20 | |
| |
4.4 | 21 | == Examples == |
![]() |
1.1 | 22 | |
| |
4.4 | 23 | All dynmically created fields of a primal form field are selected with //org_name//. |
![]() |
1.1 | 24 | |
| 25 | {{code language="javascript"}} | ||
| |
4.4 | 26 | $("[name=tf1]") // Selects the non-dynamic textfield tf1. |
| 27 | $("[org_name=tf2]") // Selects all dynamically created versions of the textfield tf2. | ||
![]() |
1.1 | 28 | {{/code}} |
| 29 | |||
| |
4.4 | 30 | To like select the second duplicated element of a dynamic element with the name //tf1//, the following code can be used. |
![]() |
1.1 | 31 | |
| 32 | {{code language="javascript"}} | ||
| |
4.4 | 33 | $($("[org_name=tf1]").get(1)) // Selects the second dynamically created element of the textfield tf1. |
![]() |
1.1 | 34 | {{/code}} |
