Form with Multiple Columns?
I defined the following simple form:
<form:SimpleForm id="SimpleFormChange354"
editable="true"
layout="ResponsiveGridLayout"
title="Address"
labelSpanXL="2"
labelSpanL="2"
labelSpanM="3"
labelSpanS="12"
adjustLabelSpan="false"
emptySpanXL="0"
emptySpanL="0"
emptySpanM="0"
emptySpanS="0"
columnsXL="2"
columnsL="2"
columnsM="1"
singleContainerFullSize="false"
>
<Label text="Name1"/>
<Input/>
<Label text="Name2"/>
<Input/>
<Label text="Name3"/>
<Input/>
</form:SimpleForm>
As you can see:

How to place the red marked element next to Name1 element?
sapui5
add a comment |
I defined the following simple form:
<form:SimpleForm id="SimpleFormChange354"
editable="true"
layout="ResponsiveGridLayout"
title="Address"
labelSpanXL="2"
labelSpanL="2"
labelSpanM="3"
labelSpanS="12"
adjustLabelSpan="false"
emptySpanXL="0"
emptySpanL="0"
emptySpanM="0"
emptySpanS="0"
columnsXL="2"
columnsL="2"
columnsM="1"
singleContainerFullSize="false"
>
<Label text="Name1"/>
<Input/>
<Label text="Name2"/>
<Input/>
<Label text="Name3"/>
<Input/>
</form:SimpleForm>
As you can see:

How to place the red marked element next to Name1 element?
sapui5
add a comment |
I defined the following simple form:
<form:SimpleForm id="SimpleFormChange354"
editable="true"
layout="ResponsiveGridLayout"
title="Address"
labelSpanXL="2"
labelSpanL="2"
labelSpanM="3"
labelSpanS="12"
adjustLabelSpan="false"
emptySpanXL="0"
emptySpanL="0"
emptySpanM="0"
emptySpanS="0"
columnsXL="2"
columnsL="2"
columnsM="1"
singleContainerFullSize="false"
>
<Label text="Name1"/>
<Input/>
<Label text="Name2"/>
<Input/>
<Label text="Name3"/>
<Input/>
</form:SimpleForm>
As you can see:

How to place the red marked element next to Name1 element?
sapui5
I defined the following simple form:
<form:SimpleForm id="SimpleFormChange354"
editable="true"
layout="ResponsiveGridLayout"
title="Address"
labelSpanXL="2"
labelSpanL="2"
labelSpanM="3"
labelSpanS="12"
adjustLabelSpan="false"
emptySpanXL="0"
emptySpanL="0"
emptySpanM="0"
emptySpanS="0"
columnsXL="2"
columnsL="2"
columnsM="1"
singleContainerFullSize="false"
>
<Label text="Name1"/>
<Input/>
<Label text="Name2"/>
<Input/>
<Label text="Name3"/>
<Input/>
</form:SimpleForm>
As you can see:

How to place the red marked element next to Name1 element?
sapui5
sapui5
edited Nov 11 '18 at 8:57
Boghyon Hoffmann
5,85752456
5,85752456
asked May 7 '18 at 14:46
zero_codingzero_coding
7,4262064138
7,4262064138
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In order to enable multiple columns, the property column* or the <layoutData> aggregation should be adjusted respectively in (Simple)Form.
Using ResponsiveGridLayout
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>Resources
- ResponsiveGridLayout API reference
- GridData API reference
Using ColumnLayout
As of v1.56, the new layout sap.ui.layout.form.ColumnLayout can be assigned to (Simple)Form which enables "a newspaper like style" without the need to insert any Titles, Toolbars, or any additional layout data to have multiple columns.
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>In case more adjustments are required, the layout data sap.ui.layout.form.ColumnElementDataAPI can be assigned. E.g.:
<Label text="Label 3">
<layoutData>
<form:ColumnElementData cellsSmall="3" /> <!-- default: 12 -->
</layoutData>
</Label>
Resources
- ColumnLayout API reference
Test Page for ColumnLayout (source code can be found here)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50216940%2fform-with-multiple-columns%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In order to enable multiple columns, the property column* or the <layoutData> aggregation should be adjusted respectively in (Simple)Form.
Using ResponsiveGridLayout
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>Resources
- ResponsiveGridLayout API reference
- GridData API reference
Using ColumnLayout
As of v1.56, the new layout sap.ui.layout.form.ColumnLayout can be assigned to (Simple)Form which enables "a newspaper like style" without the need to insert any Titles, Toolbars, or any additional layout data to have multiple columns.
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>In case more adjustments are required, the layout data sap.ui.layout.form.ColumnElementDataAPI can be assigned. E.g.:
<Label text="Label 3">
<layoutData>
<form:ColumnElementData cellsSmall="3" /> <!-- default: 12 -->
</layoutData>
</Label>
Resources
- ColumnLayout API reference
Test Page for ColumnLayout (source code can be found here)
add a comment |
In order to enable multiple columns, the property column* or the <layoutData> aggregation should be adjusted respectively in (Simple)Form.
Using ResponsiveGridLayout
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>Resources
- ResponsiveGridLayout API reference
- GridData API reference
Using ColumnLayout
As of v1.56, the new layout sap.ui.layout.form.ColumnLayout can be assigned to (Simple)Form which enables "a newspaper like style" without the need to insert any Titles, Toolbars, or any additional layout data to have multiple columns.
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>In case more adjustments are required, the layout data sap.ui.layout.form.ColumnElementDataAPI can be assigned. E.g.:
<Label text="Label 3">
<layoutData>
<form:ColumnElementData cellsSmall="3" /> <!-- default: 12 -->
</layoutData>
</Label>
Resources
- ColumnLayout API reference
Test Page for ColumnLayout (source code can be found here)
add a comment |
In order to enable multiple columns, the property column* or the <layoutData> aggregation should be adjusted respectively in (Simple)Form.
Using ResponsiveGridLayout
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>Resources
- ResponsiveGridLayout API reference
- GridData API reference
Using ColumnLayout
As of v1.56, the new layout sap.ui.layout.form.ColumnLayout can be assigned to (Simple)Form which enables "a newspaper like style" without the need to insert any Titles, Toolbars, or any additional layout data to have multiple columns.
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>In case more adjustments are required, the layout data sap.ui.layout.form.ColumnElementDataAPI can be assigned. E.g.:
<Label text="Label 3">
<layoutData>
<form:ColumnElementData cellsSmall="3" /> <!-- default: 12 -->
</layoutData>
</Label>
Resources
- ColumnLayout API reference
Test Page for ColumnLayout (source code can be found here)
In order to enable multiple columns, the property column* or the <layoutData> aggregation should be adjusted respectively in (Simple)Form.
Using ResponsiveGridLayout
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>Resources
- ResponsiveGridLayout API reference
- GridData API reference
Using ColumnLayout
As of v1.56, the new layout sap.ui.layout.form.ColumnLayout can be assigned to (Simple)Form which enables "a newspaper like style" without the need to insert any Titles, Toolbars, or any additional layout data to have multiple columns.
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>In case more adjustments are required, the layout data sap.ui.layout.form.ColumnElementDataAPI can be assigned. E.g.:
<Label text="Label 3">
<layoutData>
<form:ColumnElementData cellsSmall="3" /> <!-- default: 12 -->
</layoutData>
</Label>
Resources
- ColumnLayout API reference
Test Page for ColumnLayout (source code can be found here)
sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns:layout="sap.ui.layout"
xmlns:core="sap.ui.core"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via GridData"
editable="true"
layout="ResponsiveGridLayout"
>
<Label text="Label 1">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 2">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
<Label text="Label 3">
<layoutData>
<layout:GridData span="L2 M2" />
</layoutData>
</Label>
<Input>
<layoutData>
<layout:GridData span="L4 M4" />
</layoutData>
</Input>
</form:SimpleForm>
<form:SimpleForm title="Multiple Columns via Containers (columns* + sap.ui.core.Title)"
editable="true"
layout="ResponsiveGridLayout"
columnsM="2"
>
<core:Title text="Container 1" />
<Label text="Label 1" />
<Input />
<core:Title text="Container 2" />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="sequential"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>sap.ui.getCore().attachInit(() => sap.ui.require([
"sap/ui/core/mvc/XMLView",
], XMLView => XMLView.create({
definition: `<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:form="sap.ui.layout.form"
xmlns="sap.m"
>
<form:SimpleForm title="Multiple Columns via ColumnLayout"
editable="true"
layout="ColumnLayout"
columnsM="2"
>
<Label text="Label 1" />
<Input />
<Label text="Label 2" />
<Input />
<Label text="Label 3" />
<Input />
</form:SimpleForm>
</mvc:View>`
}).then(view => view.placeAt("content"))));<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.ui.core, sap.m, sap.ui.layout"
data-sap-ui-preload="async"
data-sap-ui-async="true"
data-sap-ui-theme="sap_belize"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="true"
data-sap-ui-xx-xml-processing="edge"
></script>
<body id="content" class="sapUiBody sapUiSizeCompact"></body>edited Nov 13 '18 at 14:51
answered May 7 '18 at 15:40
Boghyon HoffmannBoghyon Hoffmann
5,85752456
5,85752456
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50216940%2fform-with-multiple-columns%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown