@openui5/sap.ui.layout 1.106.0 → 1.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/package.json +2 -2
  2. package/src/sap/ui/layout/.library +1 -1
  3. package/src/sap/ui/layout/AlignedFlowLayout.js +4 -3
  4. package/src/sap/ui/layout/AssociativeSplitter.js +1 -1
  5. package/src/sap/ui/layout/BlockLayout.js +29 -26
  6. package/src/sap/ui/layout/BlockLayoutCell.js +4 -3
  7. package/src/sap/ui/layout/BlockLayoutCellData.js +1 -2
  8. package/src/sap/ui/layout/BlockLayoutRow.js +4 -3
  9. package/src/sap/ui/layout/DynamicSideContent.js +84 -80
  10. package/src/sap/ui/layout/DynamicSideContentRenderer.js +3 -3
  11. package/src/sap/ui/layout/FixFlex.js +9 -7
  12. package/src/sap/ui/layout/Grid.js +74 -71
  13. package/src/sap/ui/layout/GridData.js +1 -2
  14. package/src/sap/ui/layout/GridRenderer.js +1 -1
  15. package/src/sap/ui/layout/HorizontalLayout.js +22 -19
  16. package/src/sap/ui/layout/PaneContainer.js +1 -1
  17. package/src/sap/ui/layout/ResponsiveFlowLayout.js +35 -30
  18. package/src/sap/ui/layout/ResponsiveFlowLayoutData.js +1 -2
  19. package/src/sap/ui/layout/ResponsiveSplitter.js +1 -1
  20. package/src/sap/ui/layout/ResponsiveSplitterPage.js +1 -1
  21. package/src/sap/ui/layout/SplitPane.js +1 -1
  22. package/src/sap/ui/layout/Splitter.js +6 -5
  23. package/src/sap/ui/layout/SplitterLayoutData.js +1 -2
  24. package/src/sap/ui/layout/VerticalLayout.js +29 -26
  25. package/src/sap/ui/layout/changeHandler/AddFormContainer.js +1 -1
  26. package/src/sap/ui/layout/changeHandler/AddFormField.js +1 -1
  27. package/src/sap/ui/layout/changeHandler/AddSimpleFormField.js +8 -3
  28. package/src/sap/ui/layout/changeHandler/AddSimpleFormGroup.js +7 -2
  29. package/src/sap/ui/layout/changeHandler/HideSimpleForm.js +6 -12
  30. package/src/sap/ui/layout/changeHandler/MoveSimpleForm.js +13 -13
  31. package/src/sap/ui/layout/changeHandler/RenameFormContainer.js +1 -1
  32. package/src/sap/ui/layout/changeHandler/RenameSimpleForm.js +6 -4
  33. package/src/sap/ui/layout/changeHandler/UnhideSimpleForm.js +3 -2
  34. package/src/sap/ui/layout/cssgrid/CSSGrid.js +1 -2
  35. package/src/sap/ui/layout/cssgrid/GridBasicLayout.js +1 -2
  36. package/src/sap/ui/layout/cssgrid/GridBoxLayout.js +1 -2
  37. package/src/sap/ui/layout/cssgrid/GridItemLayoutData.js +1 -2
  38. package/src/sap/ui/layout/cssgrid/GridLayoutBase.js +1 -2
  39. package/src/sap/ui/layout/cssgrid/GridLayoutDelegate.js +1 -1
  40. package/src/sap/ui/layout/cssgrid/GridResponsiveLayout.js +1 -2
  41. package/src/sap/ui/layout/cssgrid/GridSettings.js +1 -2
  42. package/src/sap/ui/layout/cssgrid/ResponsiveColumnItemLayoutData.js +1 -2
  43. package/src/sap/ui/layout/cssgrid/ResponsiveColumnLayout.js +1 -2
  44. package/src/sap/ui/layout/form/ColumnContainerData.js +1 -2
  45. package/src/sap/ui/layout/form/ColumnElementData.js +1 -2
  46. package/src/sap/ui/layout/form/ColumnLayout.js +41 -38
  47. package/src/sap/ui/layout/form/Form.js +78 -75
  48. package/src/sap/ui/layout/form/FormContainer.js +1 -2
  49. package/src/sap/ui/layout/form/FormElement.js +1 -3
  50. package/src/sap/ui/layout/form/FormLayout.js +22 -18
  51. package/src/sap/ui/layout/form/GridContainerData.js +1 -2
  52. package/src/sap/ui/layout/form/GridElementData.js +1 -2
  53. package/src/sap/ui/layout/form/GridLayout.js +19 -16
  54. package/src/sap/ui/layout/form/ResponsiveGridLayout.js +138 -135
  55. package/src/sap/ui/layout/form/ResponsiveLayout.js +15 -12
  56. package/src/sap/ui/layout/form/SemanticFormElement.js +1 -2
  57. package/src/sap/ui/layout/form/SimpleForm.js +437 -404
  58. package/src/sap/ui/layout/library.js +2 -25
@@ -67,321 +67,324 @@ sap.ui.define([
67
67
  * <b>Note:</b> If a more complex form is needed, use the <code>{@link sap.ui.layout.form.Form Form}</code> control instead.
68
68
  *
69
69
  * @extends sap.ui.core.Control
70
- * @version 1.106.0
70
+ * @version 1.107.0
71
71
  *
72
72
  * @constructor
73
73
  * @public
74
74
  * @since 1.16.0
75
75
  * @alias sap.ui.layout.form.SimpleForm
76
- * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
77
76
  */
78
- var SimpleForm = Control.extend("sap.ui.layout.form.SimpleForm", /** @lends sap.ui.layout.form.SimpleForm.prototype */ { metadata : {
79
-
80
- library : "sap.ui.layout",
81
- properties : {
82
-
83
- /**
84
- * The maximum amount of groups (<code>{@link sap.ui.layout.form.FormContainer FormContainers}</code>) per row that is used before a new row is started.
85
- *
86
- * <b>Note:</b> If <code>{@link sap.ui.layout.form.SimpleFormLayout.ResponsiveGridLayout}</code> is used as <code>layout</code>, this property is not used.
87
- * Please use the properties <code>ColumnsL</code> and <code>ColumnsM</code> in this case.
88
- */
89
- maxContainerCols : {type : "int", group : "Appearance", defaultValue : 2},
90
-
91
- /**
92
- * The overall minimum width in pixels that is used for the <code>SimpleForm</code>.
93
- *
94
- * If the available width is below the given <code>minWidth</code> the <code>SimpleForm</code> will create a new row for the next group (<code>{@link sap.ui.layout.form.FormContainer FormContainer}</code>).
95
- * The default value is -1, meaning that inner groups (<code>{@link sap.ui.layout.form.FormContainer FormContainers}</code>) will be stacked until <code>maxContainerCols</code> is reached,
96
- * irrespective of whether a <code>width</code> is reached or the available parents width is reached.
97
- *
98
- * <b>Note:</b> This property is only used if a <code>ResponsiveLayout</code> is used as a layout.
99
- */
100
- minWidth : {type : "int", group : "Appearance", defaultValue : -1},
101
-
102
- /**
103
- * Width of the form.
104
- * @since 1.28.0
105
- */
106
- width : {type : "sap.ui.core.CSSSize", group : "Dimension", defaultValue : null},
107
-
108
- /**
109
- * Applies a device-specific and theme-specific line height and label alignment to the form rows if the form has editable content.
110
- * If set, all (not only the editable) rows of the form will get the line height of editable fields.
111
- *
112
- * The labels inside the form will be rendered by default in the according mode.
113
- *
114
- * <b>Note:</b> The setting of this property does not change the content of the form.
115
- * For example, <code>Input</code> controls in a form with <code>editable</code> set to false are still editable.
116
- *
117
- * <b>Warning:</b> If this property is wrongly set, this might lead to visual issues.
118
- * The labels and fields might be misaligned, the labels might be rendered in the wrong mode,
119
- * and the spacing between the single controls might be wrong.
120
- * Also, controls that do not fit the mode might be rendered incorrectly.
121
- */
122
- editable : {type : "boolean", group : "Misc", defaultValue : null},
123
-
124
- /**
125
- * Specifies the min-width in pixels of the label in all form rows.
126
- *
127
- * <b>Note:</b> This property is only used if a <code>ResponsiveLayout</code> is used as a layout.
128
- */
129
- labelMinWidth : {type : "int", group : "Misc", defaultValue : 192},
130
-
131
- /**
132
- * The <code>FormLayout</code> that is used to render the <code>SimpleForm</code>.
133
- *
134
- * We recommend using the <code>ColumnLayout</code> for rendering a <code>SimpleForm</code>,
135
- * as its responsiveness uses the space available in the best way possible.
136
- *
137
- * <b>Note</b> If possible, set the <code>layout</code> before adding content to prevent calculations for the default layout.
138
- *
139
- * <b>Note</b> The <code>ResponsiveLayout</code> has been deprecated and must no longer be used. For compatibility reasons the default could not be changed.
140
- */
141
- layout : {type : "sap.ui.layout.form.SimpleFormLayout", group : "Misc", defaultValue : SimpleFormLayout.ResponsiveLayout},
142
-
143
- /**
144
- * Default span for labels in extra large size.
145
- *
146
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
147
- * If the default value -1 is not overwritten with the meaningful one then the <code>labelSpanL</code> value is used (from the backward compatibility reasons).
148
- * @since 1.34.0
149
- */
150
- labelSpanXL : {type : "int", group : "Misc", defaultValue : -1},
151
-
152
- /**
153
- * Default span for labels in large size.
154
- *
155
- * <b>Note:</b> If <code>adjustLabelSpan</code> is set, this property is only used if more than 1 <code>FormContainer</code> is in one line.
156
- * If only 1 <code>FormContainer</code> is in the line, then the <code>labelSpanM</code> value is used.
157
- *
158
- * <b>Note:</b> This property is only used if <code>ResponsiveGridLayout</code> or <code>ColumnLayout</code> is used as a layout.
159
- * If a <code>ColumnLayout</code> is used, this property defines the label size for large columns.
160
- * @since 1.16.3
161
- */
162
- labelSpanL : {type : "int", group : "Misc", defaultValue : 4},
163
-
164
- /**
165
- * Default span for labels in medium size.
166
- *
167
- * <b>Note:</b> If <code>adjustLabelSpan</code> is set, this property is used for full-size <code>FormContainers</code>.
168
- * If more than one <code>FormContainer</code> is in one line, <code>labelSpanL</code> is used.
169
- *
170
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
171
- * @since 1.16.3
172
- */
173
- labelSpanM : {type : "int", group : "Misc", defaultValue : 2},
174
-
175
- /**
176
- * Default span for labels in small size.
177
- *
178
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
179
- * @since 1.16.3
180
- */
181
- labelSpanS : {type : "int", group : "Misc", defaultValue : 12},
182
-
183
- /**
184
- * If set, the usage of <code>labelSpanL</code> and <code>labelSpanM</code> are dependent on the number of <code>FormContainers</code> in one row.
185
- * If only one <code>FormContainer</code> is displayed in one row, <code>labelSpanM</code> is used to define the size of the label.
186
- * This is the same for medium and large <code>Forms</code>.
187
- * This is done to align the labels on forms where full-size <code>FormContainers</code> and multiple-column rows are used in the same <code>Form</code>
188
- * (because every <code>FormContainer</code> has its own grid inside).
189
- *
190
- * If not set, the usage of <code>labelSpanL</code> and <code>labelSpanM</code> are dependent on the <code>Form</code> size.
191
- * The number of <code>FormContainers</code> doesn't matter in this case.
192
- *
193
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
194
- * @since 1.34.0
195
- */
196
- adjustLabelSpan : {type : "boolean", group : "Misc", defaultValue : true},
197
-
198
- /**
199
- * Number of grid cells that are empty at the end of each line on extra large size.
200
- *
201
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
202
- * If the default value -1 is not overwritten with the meaningful one then the <code>emptySpanL</code> value is used (from the backward compatibility reasons).
203
- * @since 1.34.0
204
- */
205
- emptySpanXL : {type : "int", group : "Misc", defaultValue : -1},
206
-
207
- /**
208
- * Number of grid cells that are empty at the end of each line on large size.
209
- *
210
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
211
- * If a <code>ColumnLayout</code> is used, this property defines the empty cells for large columns.
212
- * @since 1.16.3
213
- */
214
- emptySpanL : {type : "int", group : "Misc", defaultValue : 0},
215
-
216
- /**
217
- * Number of grid cells that are empty at the end of each line on medium size.
218
- *
219
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
220
- * @since 1.16.3
221
- */
222
- emptySpanM : {type : "int", group : "Misc", defaultValue : 0},
223
-
224
- /**
225
- * Number of grid cells that are empty at the end of each line on small size.
226
- *
227
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
228
- * @since 1.16.3
229
- */
230
- emptySpanS : {type : "int", group : "Misc", defaultValue : 0},
231
-
232
- /**
233
- * Form columns for extra large size.
234
- * The number of columns for extra large size must not be smaller than the number of columns for large size.
235
- *
236
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
237
- * If the default value -1 is not overwritten with the meaningful one then the <code>columnsL</code> value is used (from the backward compatibility reasons).
238
- * @since 1.34.0
239
- */
240
- columnsXL : {type : "int", group : "Misc", defaultValue : -1},
241
-
242
- /**
243
- * Form columns for large size.
244
- * The number of columns for large size must not be smaller than the number of columns for medium size.
245
- *
246
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
247
- * @since 1.16.3
248
- */
249
- columnsL : {type : "int", group : "Misc", defaultValue : 2},
250
-
251
- /**
252
- * Form columns for medium size.
253
- *
254
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
255
- * @since 1.16.3
256
- */
257
- columnsM : {type : "int", group : "Misc", defaultValue : 1},
258
-
259
- /**
260
- * If the <code>Form</code> contains only one single <code>FormContainer</code> and this property is set,
261
- * the <code>FormContainer</code> is displayed using the full size of the <code>Form</code>.
262
- * In this case the properties <code>columnsL</code> and <code>columnsM</code> are ignored.
263
- *
264
- * In all other cases the <code>FormContainer</code> is displayed in the size of one column.
265
- *
266
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
267
- * @since 1.34.0
268
- */
269
- singleContainerFullSize : {type : "boolean", group : "Misc", defaultValue : true},
270
-
271
- /**
272
- * Breakpoint between Medium size and Large size.
273
- *
274
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
275
- * @since 1.34.0
276
- */
277
- breakpointXL : {type : "int", group : "Misc", defaultValue : 1440},
278
-
279
- /**
280
- * Breakpoint between Medium size and Large size.
281
- *
282
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
283
- * @since 1.16.3
284
- */
285
- breakpointL : {type : "int", group : "Misc", defaultValue : 1024},
286
-
287
- /**
288
- * Breakpoint between Small size and Medium size.
289
- *
290
- * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
291
- * @since 1.16.3
292
- */
293
- breakpointM : {type : "int", group : "Misc", defaultValue : 600},
294
-
295
- /**
296
- * Specifies the background color of the <code>SimpleForm</code> content.
297
- *
298
- * The visualization of the different options depends on the used theme.
299
- *
300
- * @since 1.36.0
301
- */
302
- backgroundDesign : {type : "sap.ui.layout.BackgroundDesign", group : "Appearance", defaultValue : BackgroundDesign.Translucent}
77
+ var SimpleForm = Control.extend("sap.ui.layout.form.SimpleForm", /** @lends sap.ui.layout.form.SimpleForm.prototype */ {
78
+ metadata : {
79
+
80
+ library : "sap.ui.layout",
81
+ properties : {
82
+
83
+ /**
84
+ * The maximum amount of groups (<code>{@link sap.ui.layout.form.FormContainer FormContainers}</code>) per row that is used before a new row is started.
85
+ *
86
+ * <b>Note:</b> If <code>{@link sap.ui.layout.form.SimpleFormLayout.ResponsiveGridLayout}</code> is used as <code>layout</code>, this property is not used.
87
+ * Please use the properties <code>ColumnsL</code> and <code>ColumnsM</code> in this case.
88
+ */
89
+ maxContainerCols : {type : "int", group : "Appearance", defaultValue : 2},
90
+
91
+ /**
92
+ * The overall minimum width in pixels that is used for the <code>SimpleForm</code>.
93
+ *
94
+ * If the available width is below the given <code>minWidth</code> the <code>SimpleForm</code> will create a new row for the next group (<code>{@link sap.ui.layout.form.FormContainer FormContainer}</code>).
95
+ * The default value is -1, meaning that inner groups (<code>{@link sap.ui.layout.form.FormContainer FormContainers}</code>) will be stacked until <code>maxContainerCols</code> is reached,
96
+ * irrespective of whether a <code>width</code> is reached or the available parents width is reached.
97
+ *
98
+ * <b>Note:</b> This property is only used if a <code>ResponsiveLayout</code> is used as a layout.
99
+ */
100
+ minWidth : {type : "int", group : "Appearance", defaultValue : -1},
101
+
102
+ /**
103
+ * Width of the form.
104
+ * @since 1.28.0
105
+ */
106
+ width : {type : "sap.ui.core.CSSSize", group : "Dimension", defaultValue : null},
107
+
108
+ /**
109
+ * Applies a device-specific and theme-specific line height and label alignment to the form rows if the form has editable content.
110
+ * If set, all (not only the editable) rows of the form will get the line height of editable fields.
111
+ *
112
+ * The labels inside the form will be rendered by default in the according mode.
113
+ *
114
+ * <b>Note:</b> The setting of this property does not change the content of the form.
115
+ * For example, <code>Input</code> controls in a form with <code>editable</code> set to false are still editable.
116
+ *
117
+ * <b>Warning:</b> If this property is wrongly set, this might lead to visual issues.
118
+ * The labels and fields might be misaligned, the labels might be rendered in the wrong mode,
119
+ * and the spacing between the single controls might be wrong.
120
+ * Also, controls that do not fit the mode might be rendered incorrectly.
121
+ */
122
+ editable : {type : "boolean", group : "Misc", defaultValue : null},
123
+
124
+ /**
125
+ * Specifies the min-width in pixels of the label in all form rows.
126
+ *
127
+ * <b>Note:</b> This property is only used if a <code>ResponsiveLayout</code> is used as a layout.
128
+ */
129
+ labelMinWidth : {type : "int", group : "Misc", defaultValue : 192},
130
+
131
+ /**
132
+ * The <code>FormLayout</code> that is used to render the <code>SimpleForm</code>.
133
+ *
134
+ * We recommend using the <code>ColumnLayout</code> for rendering a <code>SimpleForm</code>,
135
+ * as its responsiveness uses the space available in the best way possible.
136
+ *
137
+ * <b>Note</b> If possible, set the <code>layout</code> before adding content to prevent calculations for the default layout.
138
+ *
139
+ * <b>Note</b> The <code>ResponsiveLayout</code> has been deprecated and must no longer be used. For compatibility reasons the default could not be changed.
140
+ */
141
+ layout : {type : "sap.ui.layout.form.SimpleFormLayout", group : "Misc", defaultValue : SimpleFormLayout.ResponsiveLayout},
142
+
143
+ /**
144
+ * Default span for labels in extra large size.
145
+ *
146
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
147
+ * If the default value -1 is not overwritten with the meaningful one then the <code>labelSpanL</code> value is used (from the backward compatibility reasons).
148
+ * @since 1.34.0
149
+ */
150
+ labelSpanXL : {type : "int", group : "Misc", defaultValue : -1},
151
+
152
+ /**
153
+ * Default span for labels in large size.
154
+ *
155
+ * <b>Note:</b> If <code>adjustLabelSpan</code> is set, this property is only used if more than 1 <code>FormContainer</code> is in one line.
156
+ * If only 1 <code>FormContainer</code> is in the line, then the <code>labelSpanM</code> value is used.
157
+ *
158
+ * <b>Note:</b> This property is only used if <code>ResponsiveGridLayout</code> or <code>ColumnLayout</code> is used as a layout.
159
+ * If a <code>ColumnLayout</code> is used, this property defines the label size for large columns.
160
+ * @since 1.16.3
161
+ */
162
+ labelSpanL : {type : "int", group : "Misc", defaultValue : 4},
163
+
164
+ /**
165
+ * Default span for labels in medium size.
166
+ *
167
+ * <b>Note:</b> If <code>adjustLabelSpan</code> is set, this property is used for full-size <code>FormContainers</code>.
168
+ * If more than one <code>FormContainer</code> is in one line, <code>labelSpanL</code> is used.
169
+ *
170
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
171
+ * @since 1.16.3
172
+ */
173
+ labelSpanM : {type : "int", group : "Misc", defaultValue : 2},
174
+
175
+ /**
176
+ * Default span for labels in small size.
177
+ *
178
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
179
+ * @since 1.16.3
180
+ */
181
+ labelSpanS : {type : "int", group : "Misc", defaultValue : 12},
182
+
183
+ /**
184
+ * If set, the usage of <code>labelSpanL</code> and <code>labelSpanM</code> are dependent on the number of <code>FormContainers</code> in one row.
185
+ * If only one <code>FormContainer</code> is displayed in one row, <code>labelSpanM</code> is used to define the size of the label.
186
+ * This is the same for medium and large <code>Forms</code>.
187
+ * This is done to align the labels on forms where full-size <code>FormContainers</code> and multiple-column rows are used in the same <code>Form</code>
188
+ * (because every <code>FormContainer</code> has its own grid inside).
189
+ *
190
+ * If not set, the usage of <code>labelSpanL</code> and <code>labelSpanM</code> are dependent on the <code>Form</code> size.
191
+ * The number of <code>FormContainers</code> doesn't matter in this case.
192
+ *
193
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
194
+ * @since 1.34.0
195
+ */
196
+ adjustLabelSpan : {type : "boolean", group : "Misc", defaultValue : true},
197
+
198
+ /**
199
+ * Number of grid cells that are empty at the end of each line on extra large size.
200
+ *
201
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
202
+ * If the default value -1 is not overwritten with the meaningful one then the <code>emptySpanL</code> value is used (from the backward compatibility reasons).
203
+ * @since 1.34.0
204
+ */
205
+ emptySpanXL : {type : "int", group : "Misc", defaultValue : -1},
206
+
207
+ /**
208
+ * Number of grid cells that are empty at the end of each line on large size.
209
+ *
210
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
211
+ * If a <code>ColumnLayout</code> is used, this property defines the empty cells for large columns.
212
+ * @since 1.16.3
213
+ */
214
+ emptySpanL : {type : "int", group : "Misc", defaultValue : 0},
215
+
216
+ /**
217
+ * Number of grid cells that are empty at the end of each line on medium size.
218
+ *
219
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
220
+ * @since 1.16.3
221
+ */
222
+ emptySpanM : {type : "int", group : "Misc", defaultValue : 0},
223
+
224
+ /**
225
+ * Number of grid cells that are empty at the end of each line on small size.
226
+ *
227
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
228
+ * @since 1.16.3
229
+ */
230
+ emptySpanS : {type : "int", group : "Misc", defaultValue : 0},
231
+
232
+ /**
233
+ * Form columns for extra large size.
234
+ * The number of columns for extra large size must not be smaller than the number of columns for large size.
235
+ *
236
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
237
+ * If the default value -1 is not overwritten with the meaningful one then the <code>columnsL</code> value is used (from the backward compatibility reasons).
238
+ * @since 1.34.0
239
+ */
240
+ columnsXL : {type : "int", group : "Misc", defaultValue : -1},
241
+
242
+ /**
243
+ * Form columns for large size.
244
+ * The number of columns for large size must not be smaller than the number of columns for medium size.
245
+ *
246
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
247
+ * @since 1.16.3
248
+ */
249
+ columnsL : {type : "int", group : "Misc", defaultValue : 2},
250
+
251
+ /**
252
+ * Form columns for medium size.
253
+ *
254
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> or a <code>ColumnLayout</code> is used as a layout.
255
+ * @since 1.16.3
256
+ */
257
+ columnsM : {type : "int", group : "Misc", defaultValue : 1},
258
+
259
+ /**
260
+ * If the <code>Form</code> contains only one single <code>FormContainer</code> and this property is set,
261
+ * the <code>FormContainer</code> is displayed using the full size of the <code>Form</code>.
262
+ * In this case the properties <code>columnsL</code> and <code>columnsM</code> are ignored.
263
+ *
264
+ * In all other cases the <code>FormContainer</code> is displayed in the size of one column.
265
+ *
266
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
267
+ * @since 1.34.0
268
+ */
269
+ singleContainerFullSize : {type : "boolean", group : "Misc", defaultValue : true},
270
+
271
+ /**
272
+ * Breakpoint between Medium size and Large size.
273
+ *
274
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
275
+ * @since 1.34.0
276
+ */
277
+ breakpointXL : {type : "int", group : "Misc", defaultValue : 1440},
278
+
279
+ /**
280
+ * Breakpoint between Medium size and Large size.
281
+ *
282
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
283
+ * @since 1.16.3
284
+ */
285
+ breakpointL : {type : "int", group : "Misc", defaultValue : 1024},
286
+
287
+ /**
288
+ * Breakpoint between Small size and Medium size.
289
+ *
290
+ * <b>Note:</b> This property is only used if a <code>ResponsiveGridLayout</code> is used as a layout.
291
+ * @since 1.16.3
292
+ */
293
+ breakpointM : {type : "int", group : "Misc", defaultValue : 600},
294
+
295
+ /**
296
+ * Specifies the background color of the <code>SimpleForm</code> content.
297
+ *
298
+ * The visualization of the different options depends on the used theme.
299
+ *
300
+ * @since 1.36.0
301
+ */
302
+ backgroundDesign : {type : "sap.ui.layout.BackgroundDesign", group : "Appearance", defaultValue : BackgroundDesign.Translucent}
303
+ },
304
+ defaultAggregation : "content",
305
+ aggregations : {
306
+
307
+ /**
308
+ * The content of the form is structured in the following way:
309
+ * <ul>
310
+ * <li>Add a <code>sap.ui.core.Title</code> element or <code>Toolbar</code> control to start a new group (<code>{@link sap.ui.layout.form.FormContainer FormContainer}</code>).</li>
311
+ * <li>Add a <code>Label</code> control to start a new row (<code>{@link sap.ui.layout.form.FormElement FormElement}</code>).</li>
312
+ * <li>Add controls as input fields, text fields or other as needed.</li>
313
+ * <li>Use <code>LayoutData</code> to influence the layout for special cases in the single controls.
314
+ * For example, if a <code>ColumnLayout</code> is used as a layout,
315
+ * the form content is weighted using 4 cells for the labels and 8 cells for the field part, for large size.
316
+ * If there is only little space, the labels are above the fields and each field uses 12 cells.
317
+ * If your input controls should influence their width, you can add <code>sap.ui.layout.ColumnElementData</code>
318
+ * to them via <code>setLayoutData</code> method.
319
+ * Ensure that the sum of the weights in the <code>ColumnElementData</code> is not more than 12,
320
+ * as this is the total width of the input control part of each form row.</li>
321
+ * </ul>
322
+ * Example for a row where the <code>Input</code> uses 6 cells and the second <code>Input</code> uses 2 cells (using <code>ColumnElementData</code>):
323
+ * <pre>
324
+ * new sap.m.Label({text:"Label"});
325
+ * new sap.m.Input({value:"6 cells", layoutData: new sap.ui.layout.ColumnElementData({cellsLarge: 6, cellsSmall: 8})}),
326
+ * new sap.m.Input({value:"2 cells", layoutData: new sap.ui.layout.ColumnElementData({cellsLarge: 2, cellsSmall: 4})}),
327
+ * </pre>
328
+ *
329
+ * For example, if a <code>ResponsiveGridLayout</code> is used as a layout, there are 12 cells in one row.
330
+ * Depending on the screen size the labels use the defined <code>labelSpan</code>.
331
+ * The remaining cells are used for the fields (and <code>emptySpan</code> if defined).
332
+ * The available cells are distributed to all fields in the row. If one field should use a fixed number of cells
333
+ * you can add <code>sap.ui.layout.GridData</code> to them via <code>setLayoutData</code> method.
334
+ * If there are additional fields in the row they will get the remaining cells.
335
+ * </ul>
336
+ * Example for a row with two <code>Input</code> controls where one uses four cells on small screens,
337
+ * one cell on medium screens and 2 cells on larger screens (using <code>ResponsiveGridLayout</code>):
338
+ * <pre>
339
+ * new sap.m.Label({text:"Label"});
340
+ * new sap.m.Input({value:"auto size"}),
341
+ * new sap.m.Input({value:"fix size", layoutData: new sap.ui.layout.GridData({span: "XL1 L1 M2 S4"})}),
342
+ * </pre>
343
+ *
344
+ * <b>Warning:</b> Do not put any layout or other container controls in here. This could damage the visual layout,
345
+ * keyboard support and screen-reader support. Only labels, titles, toolbars and form controls are allowed.
346
+ * Views are also not supported. Allowed form controls implement the interface <code>sap.ui.core.IFormContent</code>.
347
+ *
348
+ * If editable controls are used as content, the <code>editable</code> property must be set to <code>true</code>,
349
+ * otherwise to <code>false</code>. If the <code>editable</code> property is set incorrectly, there will be visual issues
350
+ * like wrong label alignment or wrong spacing between the controls.
351
+ */
352
+ content : {type : "sap.ui.core.Element", multiple : true, singularName : "content"},
353
+
354
+ /**
355
+ * Hidden, for internal use only.
356
+ */
357
+ form : {type : "sap.ui.layout.form.Form", multiple : false, visibility : "hidden"},
358
+
359
+ /**
360
+ * Title element of the <code>SimpleForm</code>. Can either be a <code>Title</code> element, or a string.
361
+ * @since 1.16.3
362
+ */
363
+ title : {type : "sap.ui.core.Title", altTypes : ["string"], multiple : false},
364
+
365
+ /**
366
+ * Toolbar of the <code>SimpleForm</code>.
367
+ *
368
+ * <b>Note:</b> If a <code>Toolbar</code> is used, the <code>Title</code> is ignored.
369
+ * If a title is needed inside the <code>Toolbar</code> it must be added at content to the <code>Toolbar</code>.
370
+ * In this case add the <code>Title</code> to the <code>ariaLabelledBy</code> association.
371
+ * @since 1.36.0
372
+ */
373
+ toolbar : {type : "sap.ui.core.Toolbar", multiple : false}
374
+ },
375
+ associations: {
376
+
377
+ /**
378
+ * Association to controls / IDs which label this control (see WAI-ARIA attribute <code>aria-labelledby</code>).
379
+ * @since 1.32.0
380
+ */
381
+ ariaLabelledBy: { type: "sap.ui.core.Control", multiple: true, singularName: "ariaLabelledBy" }
382
+ },
383
+ designtime: "sap/ui/layout/designtime/form/SimpleForm.designtime"
303
384
  },
304
- defaultAggregation : "content",
305
- aggregations : {
306
-
307
- /**
308
- * The content of the form is structured in the following way:
309
- * <ul>
310
- * <li>Add a <code>sap.ui.core.Title</code> element or <code>Toolbar</code> control to start a new group (<code>{@link sap.ui.layout.form.FormContainer FormContainer}</code>).</li>
311
- * <li>Add a <code>Label</code> control to start a new row (<code>{@link sap.ui.layout.form.FormElement FormElement}</code>).</li>
312
- * <li>Add controls as input fields, text fields or other as needed.</li>
313
- * <li>Use <code>LayoutData</code> to influence the layout for special cases in the single controls.
314
- * For example, if a <code>ColumnLayout</code> is used as a layout,
315
- * the form content is weighted using 4 cells for the labels and 8 cells for the field part, for large size.
316
- * If there is only little space, the labels are above the fields and each field uses 12 cells.
317
- * If your input controls should influence their width, you can add <code>sap.ui.layout.ColumnElementData</code>
318
- * to them via <code>setLayoutData</code> method.
319
- * Ensure that the sum of the weights in the <code>ColumnElementData</code> is not more than 12,
320
- * as this is the total width of the input control part of each form row.</li>
321
- * </ul>
322
- * Example for a row where the <code>Input</code> uses 6 cells and the second <code>Input</code> uses 2 cells (using <code>ColumnElementData</code>):
323
- * <pre>
324
- * new sap.m.Label({text:"Label"});
325
- * new sap.m.Input({value:"6 cells", layoutData: new sap.ui.layout.ColumnElementData({cellsLarge: 6, cellsSmall: 8})}),
326
- * new sap.m.Input({value:"2 cells", layoutData: new sap.ui.layout.ColumnElementData({cellsLarge: 2, cellsSmall: 4})}),
327
- * </pre>
328
- *
329
- * For example, if a <code>ResponsiveGridLayout</code> is used as a layout, there are 12 cells in one row.
330
- * Depending on the screen size the labels use the defined <code>labelSpan</code>.
331
- * The remaining cells are used for the fields (and <code>emptySpan</code> if defined).
332
- * The available cells are distributed to all fields in the row. If one field should use a fixed number of cells
333
- * you can add <code>sap.ui.layout.GridData</code> to them via <code>setLayoutData</code> method.
334
- * If there are additional fields in the row they will get the remaining cells.
335
- * </ul>
336
- * Example for a row with two <code>Input</code> controls where one uses four cells on small screens,
337
- * one cell on medium screens and 2 cells on larger screens (using <code>ResponsiveGridLayout</code>):
338
- * <pre>
339
- * new sap.m.Label({text:"Label"});
340
- * new sap.m.Input({value:"auto size"}),
341
- * new sap.m.Input({value:"fix size", layoutData: new sap.ui.layout.GridData({span: "XL1 L1 M2 S4"})}),
342
- * </pre>
343
- *
344
- * <b>Warning:</b> Do not put any layout or other container controls in here. This could damage the visual layout,
345
- * keyboard support and screen-reader support. Only labels, titles, toolbars and form controls are allowed.
346
- * Views are also not supported. Allowed form controls implement the interface <code>sap.ui.core.IFormContent</code>.
347
- *
348
- * If editable controls are used as content, the <code>editable</code> property must be set to <code>true</code>,
349
- * otherwise to <code>false</code>. If the <code>editable</code> property is set incorrectly, there will be visual issues
350
- * like wrong label alignment or wrong spacing between the controls.
351
- */
352
- content : {type : "sap.ui.core.Element", multiple : true, singularName : "content"},
353
-
354
- /**
355
- * Hidden, for internal use only.
356
- */
357
- form : {type : "sap.ui.layout.form.Form", multiple : false, visibility : "hidden"},
358
-
359
- /**
360
- * Title element of the <code>SimpleForm</code>. Can either be a <code>Title</code> element, or a string.
361
- * @since 1.16.3
362
- */
363
- title : {type : "sap.ui.core.Title", altTypes : ["string"], multiple : false},
364
-
365
- /**
366
- * Toolbar of the <code>SimpleForm</code>.
367
- *
368
- * <b>Note:</b> If a <code>Toolbar</code> is used, the <code>Title</code> is ignored.
369
- * If a title is needed inside the <code>Toolbar</code> it must be added at content to the <code>Toolbar</code>.
370
- * In this case add the <code>Title</code> to the <code>ariaLabelledBy</code> association.
371
- * @since 1.36.0
372
- */
373
- toolbar : {type : "sap.ui.core.Toolbar", multiple : false}
374
- },
375
- associations: {
376
385
 
377
- /**
378
- * Association to controls / IDs which label this control (see WAI-ARIA attribute <code>aria-labelledby</code>).
379
- * @since 1.32.0
380
- */
381
- ariaLabelledBy: { type: "sap.ui.core.Control", multiple: true, singularName: "ariaLabelledBy" }
382
- },
383
- designtime: "sap/ui/layout/designtime/form/SimpleForm.designtime"
384
- }});
386
+ renderer: SimpleFormRenderer
387
+ });
385
388
 
386
389
  SimpleForm.prototype.init = function() {
387
390
 
@@ -605,6 +608,7 @@ sap.ui.define([
605
608
  var oFormElement;
606
609
  var oParent;
607
610
  var oLayoutData;
611
+ var sLayout = this.getLayout();
608
612
 
609
613
  if (oElement.isA(["sap.ui.core.Title", "sap.ui.core.Toolbar"])) {
610
614
  //start a new container with a title
@@ -639,7 +643,7 @@ sap.ui.define([
639
643
  oFormContainer = oParent.getParent();
640
644
  oFormElement = oParent;
641
645
  oLayoutData = _getFieldLayoutData.call(this, oElement);
642
- if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") &&
646
+ if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") && sLayout === SimpleFormLayout.ResponsiveLayout &&
643
647
  !_isMyLayoutData.call(this, oLayoutData) && oLayoutData.getLinebreak()) {
644
648
  oFormElement = _addFormElement.call(this, oFormContainer);
645
649
  }
@@ -718,55 +722,55 @@ sap.ui.define([
718
722
  var i = 0;
719
723
  var oField;
720
724
  var oLayoutData;
725
+ var sLayout = this.getLayout();
721
726
 
722
727
  if (oElement.isA(["sap.ui.core.Title", "sap.ui.core.Toolbar"])) {
723
728
  //start a new container with a title
729
+ oFormContainer = _createFormContainer.call(this, oElement);
724
730
  if (iIndex == 0 && !(oOldElement.isA(["sap.ui.core.Title", "sap.ui.core.Toolbar"]))) {
725
- // special case - index==0 and first container has no title -> just add title to Container
726
- oFormContainer = oOldElement.getParent().getParent();
727
- if (oElement.isA("sap.ui.core.Title")) {
728
- oFormContainer.setTitle(oElement);
729
- } else {
730
- oFormContainer.setToolbar(oElement);
731
+ // special case - index==0 and first container has no title -> move FormElements to new Container and destroy old one (to have a stable ID based on Title)
732
+ oOldFormContainer = oOldElement.getParent().getParent();
733
+ aFormElements = oOldFormContainer.getFormElements();
734
+ for (i = 0; i < aFormElements.length; i++) {
735
+ oFormContainer.addFormElement(aFormElements[i]);
731
736
  }
737
+ oOldFormContainer.destroy();
738
+ iContainerIndex = 0;
739
+ } else if (oOldElement.isA(["sap.ui.core.Title", "sap.ui.core.Toolbar"])) {
740
+ // insert before old container
741
+ oOldFormContainer = oOldElement.getParent();
742
+ iContainerIndex = oForm.indexOfFormContainer(oOldFormContainer);
732
743
  } else {
733
- oFormContainer = _createFormContainer.call(this, oElement);
734
- if (oOldElement.isA(["sap.ui.core.Title", "sap.ui.core.Toolbar"])) {
735
- // insert before old container
736
- oOldFormContainer = oOldElement.getParent();
737
- iContainerIndex = oForm.indexOfFormContainer(oOldFormContainer);
738
- } else {
739
- // insert after old container
740
- oOldFormElement = oOldElement.getParent();
741
- oOldFormContainer = oOldFormElement.getParent();
742
- iContainerIndex = oForm.indexOfFormContainer(oOldFormContainer) + 1;
743
- iElementIndex = oOldFormContainer.indexOfFormElement(oOldFormElement);
744
-
745
- // check if old FormElement must be splited
746
- if (!oOldElement.isA("sap.ui.core.Label")) {
747
- iFieldIndex = oOldFormElement.indexOfField(oOldElement);
748
- if (iFieldIndex > 0 || oOldFormElement.getLabel()) {
749
- // split FormElement
750
- oFormElement = _addFormElement.call(this, oFormContainer);
751
- this._changedFormElements.push(oFormElement);
752
- _markFormElementForUpdate(this._changedFormElements, oOldFormElement);
753
- // move all Fields after index into new FormElement
754
- aFields = oOldFormElement.getFields();
755
- for ( i = iFieldIndex; i < aFields.length; i++) {
756
- oField = aFields[i];
757
- oFormElement.addField(oField);
758
- }
759
- iElementIndex++;
744
+ // insert after old container
745
+ oOldFormElement = oOldElement.getParent();
746
+ oOldFormContainer = oOldFormElement.getParent();
747
+ iContainerIndex = oForm.indexOfFormContainer(oOldFormContainer) + 1;
748
+ iElementIndex = oOldFormContainer.indexOfFormElement(oOldFormElement);
749
+
750
+ // check if old FormElement must be splited
751
+ if (!oOldElement.isA("sap.ui.core.Label")) {
752
+ iFieldIndex = oOldFormElement.indexOfField(oOldElement);
753
+ if (iFieldIndex > 0 || oOldFormElement.getLabel()) {
754
+ // split FormElement
755
+ oFormElement = _addFormElement.call(this, oFormContainer);
756
+ this._changedFormElements.push(oFormElement);
757
+ _markFormElementForUpdate(this._changedFormElements, oOldFormElement);
758
+ // move all Fields after index into new FormElement
759
+ aFields = oOldFormElement.getFields();
760
+ for ( i = iFieldIndex; i < aFields.length; i++) {
761
+ oField = aFields[i];
762
+ oFormElement.addField(oField);
760
763
  }
761
- }
762
- // move all FormElements after the new content into the new container
763
- aFormElements = oOldFormContainer.getFormElements();
764
- for ( i = iElementIndex; i < aFormElements.length; i++) {
765
- oFormContainer.addFormElement(aFormElements[i]);
764
+ iElementIndex++;
766
765
  }
767
766
  }
768
- oForm.insertFormContainer(oFormContainer, iContainerIndex);
767
+ // move all FormElements after the new content into the new container
768
+ aFormElements = oOldFormContainer.getFormElements();
769
+ for ( i = iElementIndex; i < aFormElements.length; i++) {
770
+ oFormContainer.addFormElement(aFormElements[i]);
771
+ }
769
772
  }
773
+ oForm.insertFormContainer(oFormContainer, iContainerIndex);
770
774
  this._changedFormContainers.push(oFormContainer);
771
775
  } else if (oElement.isA("sap.ui.core.Label")) {
772
776
  if (oOldElement.isA(["sap.ui.core.Title", "sap.ui.core.Toolbar"])) {
@@ -794,22 +798,21 @@ sap.ui.define([
794
798
  oOldFormContainer = oOldFormElement.getParent();
795
799
  iElementIndex = oOldFormContainer.indexOfFormElement(oOldFormElement) + 1;
796
800
  iFieldIndex = oOldFormElement.indexOfField(oOldElement);
801
+ aFields = oOldFormElement.getFields();
802
+
803
+ oFormElement = _insertFormElement.call(this, oOldFormContainer, oElement, iElementIndex);
804
+
805
+ // move all Fields after index into new FormElement
806
+ for ( i = iFieldIndex; i < aFields.length; i++) {
807
+ oField = aFields[i];
808
+ oFormElement.addField(oField);
809
+ }
797
810
 
798
811
  if (iFieldIndex == 0 && !oOldFormElement.getLabel()) {
799
- // special case: FormElement has no label and inserted before first Field
800
- oFormElement = oOldFormElement;
801
- oFormElement.setLabel(oElement);
802
- _createFieldLayoutData.call(this, oElement, this._iLabelWeight, false, true, this.getLabelMinWidth());
812
+ // special case: FormElement has no label and inserted before first Field -> create a new one, add all Fields and destroy old one (To have stabel ID from Label)
813
+ oOldFormElement.destroy();
803
814
  } else {
804
- oFormElement = _insertFormElement.call(this, oOldFormContainer, oElement, iElementIndex);
805
815
  _markFormElementForUpdate(this._changedFormElements, oOldFormElement);
806
-
807
- // move all Fields after index into new FormElement
808
- aFields = oOldFormElement.getFields();
809
- for ( i = iFieldIndex; i < aFields.length; i++) {
810
- oField = aFields[i];
811
- oFormElement.addField(oField);
812
- }
813
816
  }
814
817
  }
815
818
  this._changedFormElements.push(oFormElement);
@@ -834,7 +837,7 @@ sap.ui.define([
834
837
  if (aFormElements.length == 0) {
835
838
  // FormContainer has no FormElements -> create one
836
839
  oFormElement = _addFormElement.call(this, oFormContainer);
837
- } else if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") &&
840
+ } else if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") && sLayout === SimpleFormLayout.ResponsiveLayout &&
838
841
  !_isMyLayoutData.call(this, oLayoutData) && oLayoutData.getLinebreak()) {
839
842
  oFormElement = _addFormElement.call(this, oFormContainer);
840
843
  } else {
@@ -851,7 +854,7 @@ sap.ui.define([
851
854
  if (iElementIndex == 0) {
852
855
  // it's already the first FormElement -> insert a new one before
853
856
  oFormElement = _insertFormElement.call(this, oFormContainer, null, 0);
854
- } else if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") &&
857
+ } else if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") && sLayout === SimpleFormLayout.ResponsiveLayout &&
855
858
  !_isMyLayoutData.call(this, oLayoutData) && oLayoutData.getLinebreak()) {
856
859
  oFormElement = _insertFormElement.call(this, oFormContainer, null, iElementIndex);
857
860
  } else {
@@ -863,7 +866,7 @@ sap.ui.define([
863
866
  // insert new field into same FormElement before old field
864
867
  oFormElement = oOldElement.getParent();
865
868
  iFieldIndex = oFormElement.indexOfField(oOldElement);
866
- if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") &&
869
+ if (oLayoutData && oLayoutData.isA("sap.ui.layout.ResponsiveFlowLayoutData") && sLayout === SimpleFormLayout.ResponsiveLayout &&
867
870
  !_isMyLayoutData.call(this, oLayoutData) && oLayoutData.getLinebreak() && iFieldIndex > 0) {
868
871
  // split FormElement
869
872
  oFormContainer = oFormElement.getParent();
@@ -937,24 +940,31 @@ sap.ui.define([
937
940
  oFormContainer = oElement.getParent();
938
941
  oFormContainer.setTitle(null);
939
942
  oFormContainer.setToolbar(null);
940
- if (iIndex > 0) {
941
- // if it's the first FormContainer -> just remove title
942
- // remove FormContainer and add content to previous FormContainer
943
- aFormElements = oFormContainer.getFormElements();
943
+ aFormElements = oFormContainer.getFormElements();
944
+ if (iIndex > 0 || aFormElements.length > 0) {
944
945
  var iContainerIndex = oForm.indexOfFormContainer(oFormContainer);
945
- var oPrevFormContainer = oForm.getFormContainers()[iContainerIndex - 1];
946
- if (aFormElements.length > 0 && !aFormElements[0].getLabel()) {
947
- // first FormElement has no label -> add its fields to last FormElement of previous FormContainer
948
- var aPrevFormElements = oPrevFormContainer.getFormElements();
949
- var oLastFormElement = aPrevFormElements[aPrevFormElements.length - 1];
950
- aFields = aFormElements[0].getFields();
951
- for (i = 0; i < aFields.length; i++) {
952
- oLastFormElement.addField(aFields[i]);
946
+ var oPrevFormContainer;
947
+ if (iIndex === 0) {
948
+ // create a new FormContainer without title and add all FormElemens (To have a stable ID on FormContainer without title)
949
+ oPrevFormContainer = _createFormContainer.call(this);
950
+ oForm.insertFormContainer(oPrevFormContainer, iContainerIndex);
951
+ } else {
952
+ // remove FormContainer and add content to previous FormContainer
953
+ oPrevFormContainer = oForm.getFormContainers()[iContainerIndex - 1];
954
+
955
+ if (aFormElements.length > 0 && !aFormElements[0].getLabel()) {
956
+ // first FormElement has no label -> add its fields to last FormElement of previous FormContainer
957
+ var aPrevFormElements = oPrevFormContainer.getFormElements();
958
+ var oLastFormElement = aPrevFormElements[aPrevFormElements.length - 1];
959
+ aFields = aFormElements[0].getFields();
960
+ for (i = 0; i < aFields.length; i++) {
961
+ oLastFormElement.addField(aFields[i]);
962
+ }
963
+ _markFormElementForUpdate(this._changedFormElements, oLastFormElement);
964
+ oFormContainer.removeFormElement(aFormElements[0]);
965
+ aFormElements[0].destroy();
966
+ aFormElements.splice(0,1);
953
967
  }
954
- _markFormElementForUpdate(this._changedFormElements, oLastFormElement);
955
- oFormContainer.removeFormElement(aFormElements[0]);
956
- aFormElements[0].destroy();
957
- aFormElements.splice(0,1);
958
968
  }
959
969
  for (i = 0; i < aFormElements.length; i++) {
960
970
  oPrevFormContainer.addFormElement(aFormElements[i]);
@@ -962,7 +972,7 @@ sap.ui.define([
962
972
  _markFormElementForUpdate(this._changedFormContainers, oPrevFormContainer);
963
973
  oForm.removeFormContainer(oFormContainer);
964
974
  oFormContainer.destroy();
965
- } else if (oFormContainer.getFormElements().length == 0) {
975
+ } else {
966
976
  // remove empty FormContainer
967
977
  oForm.removeFormContainer(oFormContainer);
968
978
  oFormContainer.destroy();
@@ -971,10 +981,12 @@ sap.ui.define([
971
981
  oFormElement = oElement.getParent();
972
982
  oFormContainer = oFormElement.getParent();
973
983
  oFormElement.setLabel(null);
984
+ aFields = oFormElement.getFields();
974
985
  var iElementIndex = oFormContainer.indexOfFormElement(oFormElement);
975
- if (iElementIndex == 0) {
976
- // its the first Element of the FormContainer -> just remove label
977
- if (oFormElement.getFields().length == 0) {
986
+ var oPrevFormElement;
987
+ if (iElementIndex === 0) {
988
+ // its the first Element of the FormContainer
989
+ if (aFields.length === 0) {
978
990
  // FormElement has no fields -> just delete
979
991
  oFormContainer.removeFormElement(oFormElement);
980
992
  oFormElement.destroy();
@@ -983,20 +995,21 @@ sap.ui.define([
983
995
  oFormContainer.destroy();
984
996
  }
985
997
  } else {
986
- _markFormElementForUpdate(this._changedFormElements, oFormElement);
998
+ // create a new FormElement, add all Fields and destroy it (To have a stable ID without Label)
999
+ oPrevFormElement = _insertFormElement.call(this, oFormContainer, null, 0);
987
1000
  }
988
1001
  } else {
989
1002
  // add fields to previous FormElement
990
1003
  aFormElements = oFormContainer.getFormElements();
991
- var oPrevFormElement = aFormElements[iElementIndex - 1];
992
- aFields = oFormElement.getFields();
993
- for (i = 0; i < aFields.length; i++) {
994
- oPrevFormElement.addField(aFields[i]);
995
- }
1004
+ oPrevFormElement = aFormElements[iElementIndex - 1];
996
1005
  _markFormElementForUpdate(this._changedFormElements, oPrevFormElement);
997
- oFormContainer.removeFormElement(oFormElement);
998
- oFormElement.destroy();
999
1006
  }
1007
+
1008
+ for (i = 0; i < aFields.length; i++) {
1009
+ oPrevFormElement.addField(aFields[i]);
1010
+ }
1011
+ oFormContainer.removeFormElement(oFormElement);
1012
+ oFormElement.destroy();
1000
1013
  } else { // remove field
1001
1014
  oFormElement = oElement.getParent();
1002
1015
  oFormElement.removeField(oElement);
@@ -1621,7 +1634,7 @@ sap.ui.define([
1621
1634
  */
1622
1635
  function _addFormElement(oFormContainer, oLabel) {
1623
1636
 
1624
- var oElement = _createFormElement.call(this, oLabel);
1637
+ var oElement = _createFormElement.call(this, oLabel, oFormContainer);
1625
1638
  oFormContainer.addFormElement(oElement);
1626
1639
  return oElement;
1627
1640
 
@@ -1629,23 +1642,36 @@ sap.ui.define([
1629
1642
 
1630
1643
  function _insertFormElement(oFormContainer, oLabel, iIndex) {
1631
1644
 
1632
- var oElement = _createFormElement.call(this, oLabel);
1645
+ var oElement = _createFormElement.call(this, oLabel, oFormContainer);
1633
1646
  oFormContainer.insertFormElement(oElement, iIndex);
1634
1647
  return oElement;
1635
1648
 
1636
1649
  }
1637
1650
 
1638
- function _createFormElement(oLabel) {
1651
+ function _createFormElement(oLabel, oFormContainer) {
1652
+
1653
+ var sId;
1654
+ var mSettings = {};
1639
1655
 
1640
- var oElement = new FormElement();
1641
- _createElementLayoutData.call(this, oElement);
1642
1656
  if (oLabel) {
1657
+ sId = oLabel.getId() + "--FE";
1643
1658
  oLabel.addStyleClass("sapUiFormLabel-CTX");
1644
- oElement.setLabel(oLabel);
1645
1659
  if (!_getFieldLayoutData.call(this, oLabel)) {
1646
1660
  _createFieldLayoutData.call(this, oLabel, this._iLabelWeight, false, true, this.getLabelMinWidth());
1647
1661
  }
1662
+ mSettings["label"] = oLabel;
1663
+ } else {
1664
+ sId = oFormContainer.getId() + "--FE-NoLabel"; // There can be only one FormElement without Label in a FomContainer (first one)
1665
+ if (sap.ui.getCore().byId(sId)) {
1666
+ // if ResponsiveLayout and ResponsiveFlowLayoutdata with Linebreak is used multiple FormElements without Label can exist
1667
+ // as already deprecated just keep generatied ID in this very special case.
1668
+ sId = undefined;
1669
+ }
1648
1670
  }
1671
+
1672
+ var oElement = new FormElement(sId, mSettings);
1673
+ _createElementLayoutData.call(this, oElement);
1674
+
1649
1675
  oElement.isVisible = function(){
1650
1676
 
1651
1677
  var aFields = this.getFields();
@@ -1676,7 +1702,21 @@ sap.ui.define([
1676
1702
  */
1677
1703
  function _createFormContainer(oTitle) {
1678
1704
 
1679
- var oContainer = new FormContainer();
1705
+ var sId;
1706
+ var mSettings = {};
1707
+
1708
+ if (oTitle) {
1709
+ sId = oTitle.getId() + "--FC";
1710
+ if (oTitle.isA("sap.ui.core.Title")) {
1711
+ mSettings["title"] = oTitle;
1712
+ } else if (oTitle.isA("sap.ui.core.Toolbar")) {
1713
+ mSettings["toolbar"] = oTitle;
1714
+ }
1715
+ } else {
1716
+ sId = this.getId() + "--FC-NoHead"; // There can be only one FormContainer without title (the first one)
1717
+ }
1718
+
1719
+ var oContainer = new FormContainer(sId, mSettings);
1680
1720
  _createContainerLayoutData.call(this, oContainer);
1681
1721
 
1682
1722
  oContainer.getAriaLabelledBy = function() {
@@ -1689,13 +1729,6 @@ sap.ui.define([
1689
1729
  }
1690
1730
  };
1691
1731
 
1692
- if (oTitle) {
1693
- if (oTitle.isA("sap.ui.core.Title")) {
1694
- oContainer.setTitle(oTitle);
1695
- } else if (oTitle.isA("sap.ui.core.Toolbar")) {
1696
- oContainer.setToolbar(oTitle);
1697
- }
1698
- }
1699
1732
  return oContainer;
1700
1733
 
1701
1734
  }