... |
... |
@@ -96,8
+96,10 @@ |
96 |
96 |
http(s):~/~/<server>/formcycle/datenquellecsv?mandantName=<Mandant-Name>&name=<Datenquellen-Name> |
97 |
97 |
{{/info}} |
98 |
98 |
|
99 |
|
-At an access of the {{designer/}} always use the global variables object //XFC_METADATA//, see also [[global designer variables>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.FormMetadata]]. For example it can be accessed as follows: {{code}}XFC_METADATA.urls.datasource_csv{{/code}}. |
|
99 |
+Bei Zugriff aus dem {{designer case="dat"/}} verwenden Sie immer das globale Variablen-Objekt //XFC_METADATA//, siehe hierzu auch [[Globale Designer Variablen>>https://jsdocs.formcycle.eu/jsdocs/de/modules/_formcycle_v6_de_d_.html#xfc_metadata||target="_blank"]]. Beispielsweise kann wie folgt darauf zugegriffen werden: {{code}}XFC_METADATA.urls.datasource_csv{{/code}}. |
100 |
100 |
|
|
101 |
+Always use the global variables object {{code}}XFC_METADATA{{/code}} when accessing data sources from the {{designer/}}, see also [[global designer variables>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.FormMetadata]]. The servlet URK can be accessed as follows: {{code}}XFC_METADATA.urls.datasource_csv{{/code}}. |
|
102 |
+ |
101 |
101 |
The following parameters are possible: |
102 |
102 |
|
103 |
103 |
|=name of the parameter|=description|=necessary |
... |
... |
@@ -111,41
+111,37 @@ |
111 |
111 |
|
112 |
112 |
=== Application example === |
113 |
113 |
|
114 |
|
-{{figure image="087En.png" width="300"}} |
115 |
|
-An example of how a CSV datasource can look. The columns are seperated through commas. |
116 |
|
-{{/figure}} |
|
116 |
+A CSV data source with the option activated: **First row is header**. It has the following content: |
117 |
117 |
|
118 |
118 |
{{code language="csv"}} |
119 |
|
-title,first name,last name,plz,location |
|
119 |
+title,firstName,lastName,zip,city |
120 |
120 |
Herr,Max,Mustermann,1000,Musterhausen |
121 |
121 |
Frau,Monika,Mustermann,2000,Musterdorf |
122 |
122 |
Frau, Luise,Musterfrau,3000,Musterstadt |
|
123 |
+ |
123 |
123 |
{{/code}} |
124 |
124 |
|
|
126 |
+In the {{designer/}} the following script is used in the [[script area>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.WebHome]] for pre-filling form fields: |
125 |
125 |
|
126 |
|
- |
127 |
|
- |
128 |
|
-In the {{designer/}} the following script is used in the [[script area>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.WebHome]]. |
129 |
|
- |
130 |
130 |
{{code language="javascript"}} |
131 |
131 |
$.getJSON( XFC_METADATA.urls.datasource_csv + "?name=Demo&mandantName=xima.de", function(json) { |
132 |
|
- var obj = json.returnValue[0] |
|
130 |
+ var obj = json.returnValue[0]; |
133 |
133 |
|
134 |
|
- $('[name=tfAnrede]').val(obj.anrede) |
135 |
|
- $('[name=tfVorname]').val(obj.vorname) |
136 |
|
- $('[name=tfName]').val(obj.nachname) |
137 |
|
- $('[name=tfPLZ]').val(obj.plz) |
138 |
|
- $('[name=tfOrt]').val(obj.ort) |
139 |
|
- }) |
|
132 |
+ $('[name=tfTitle]').val(obj.title); |
|
133 |
+ $('[name=tfFirstName]').val(obj.firstName); |
|
134 |
+ $('[name=tfLastName]').val(obj.lastName); |
|
135 |
+ $('[name=tfZIP]').val(obj.zip); |
|
136 |
+ $('[name=tfCity]').val(obj.city); |
|
137 |
+ }); |
140 |
140 |
{{/code}} |
141 |
141 |
|
142 |
|
-{{figure image="088En.png" width="300"/}} |
|
140 |
+{{lightbox image="data_source_csv_designer_script_en.png"/}} |
143 |
143 |
|
144 |
|
-This example as a data source for the {{designer/}} [[for downloading>>attach:beispiel_datenquelle_csv.json||rel="__blank"]]. |
|
142 |
+This form example is provided as a [[download>>attach:CSV-Demo_de.json||rel="__blank"]]. |
145 |
145 |
|
146 |
146 |
=== Exeption selection element === |
147 |
147 |
|
148 |
|
-{{figure image="data_source_csv_designer_de.png"}} |
|
146 |
+{{figure image="data_source_csv_designer_en.png"}} |
149 |
149 |
The connection of a data source to a selection element takes place directly in the {{designer/}} |
150 |
150 |
{{/figure}} |
151 |
151 |
|
... |
... |
@@ -154,23
+154,27 @@ |
154 |
154 |
The content of the CSV data source is processed in a [[selection element>>doc:Formcycle.FormDesigner.FormElements.Selection]]. |
155 |
155 |
|
156 |
156 |
{{code}} |
157 |
|
-visible value, assigned value, optional value, optional valuesichtbarer wert, ... |
|
155 |
+visible value, assigned value, optional value, optional value, ... |
158 |
158 |
{{/code}} |
159 |
159 |
|
160 |
|
-If more than the visible and the assigned value are indicated, so optional values, the can be invoked in JavaScript through the following jQuery selector. |
|
158 |
+Columns of the data source are use as follows for [[selection elements>>doc:Formcycle.FormDesigner.FormElements.Selection]]: |
|
159 |
+{{code}}col + column index{{/code}}. |
161 |
161 |
|
|
161 |
+If a data source has more than two columns than it contains optional values. These optional values can be accessed with JavaScript via the following jQuery selector: |
|
162 |
+ |
162 |
162 |
{{code language="javascript"}} |
163 |
|
-$('[name=sel2]').find('option:selected').attr('col0'); |
|
164 |
+$('[name=sel2]').find('option:selected').attr('col2'); |
164 |
164 |
{{/code}} |
165 |
165 |
|
166 |
|
-Every optional value is stored to the selection element as attribute {{code}}col + index of the optional value{{/code}}. At e.g. three optional values, there would be //col0//, //col1// and //col2//. |
|
167 |
+Optinal values start at column index 2. |
|
168 |
+If the first row is marked as a header than it will be ignored for selection elements. |
167 |
167 |
|
168 |
168 |
== XML == |
169 |
169 |
|
170 |
170 |
The XML data source acts analogously to the //CSV// data source, but cannot be bound to a [[selection element>>doc:Formcycle.FormDesigner.FormElements.Selection]]. |
171 |
171 |
|
172 |
|
-{{figure image="datenquelle_xml.png" width="300"}} |
173 |
|
-The JSON structure of the XML data source. To this JSON structure can than be accessed to {{code}}XFC_METADATA.urls.datasource_[csv|json|xml]{{/code}} via Javascript. |
|
174 |
+{{figure image="data_source_xml_servlet_json.png" width="300"}} |
|
175 |
+The JSON structure of the XML data source. To this JSON structure can than be accessed to {{code}}XFC_METADATA.urls.datasource_xml{{/code}} via Javascript. |
174 |
174 |
{{/figure}} |
175 |
175 |
|
176 |
176 |
=== Example for an XML data source === |
... |
... |
@@ -222,8
+222,8 @@ |
222 |
222 |
|
223 |
223 |
The //JSON// data source acts analogously to the //CSV// data source, but cannot be bound to a [[selection element>>doc:Formcycle.FormDesigner.FormElements.Selection]] directly. |
224 |
224 |
|
225 |
|
-{{figure image="datenquelle_json.png" width="300"}} |
226 |
|
-The JSON structure of the JSON data source. It is identically equal to the JSON data source. This JSON structure can be accessed via Javascript through {{code}}XFC_METADATA.urls.datasource_[csv|json|xml]{{/code}}. |
|
227 |
+{{figure image="data_source_json_servlet_json.png"}} |
|
228 |
+The JSON structure of the JSON data source. It is identically equal to the JSON data source. This JSON structure can be accessed via Javascript through {{code}}XFC_METADATA.urls.datasource_json{{/code}}. |
227 |
227 |
{{/figure}} |
228 |
228 |
|
229 |
229 |
=== Example for a JSON data source === |