Skip to Content
0

Form in a grid layout

Jan 31 at 04:22 PM

156

avatar image
Former Member

Hi,

I use a form with two columns in a horizontal alignment as in the example:

https://sapui5.hana.ondemand.com/#/sample/sap.ui.layout.sample.Form354wideDual/preview

Per default, all forms in my page will be in a grid layout and this breaks the form layout. Instead two columns next to each other, they align under each other.

I appreciate some recommendations to solve this issue.

Regards

Duygu

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member
Feb 01 at 09:43 AM
0

The code looks like this:

new sap.ui.layout.Grid({
    content:[
	 new sap.m.VBox({
		items:[
		   new sap.ui.layout.form.Form({
			editable : false,
			layout : new sap.ui.layout.form.ResponsiveGridLayout ({
				labelSpanXL : 2, labelSpanL : 2, labelSpanM : 4, labelSpanS : 12,
				adjustLabelSpan: false,
				emptySpanXL : 0, emptySpanL : 0, emptySpanM : 0, emptySpanS : 0,
				columnsXL : 2, columnsL : 2, columnsM : 2, 
				singleContainerFullSize:false
			}),
			formContainers : [
				new sap.ui.layout.form.FormContainer({title: "title1",
					formElements : new sap.ui.layout.form.FormElement({label:"Name1", fields:[new sap.m.Label({text: "bajls1"})]})
				}),
				new sap.ui.layout.form.FormContainer( {title: "title2,",
					formElements : new sap.ui.layout.form.FormElement({label:"Name2", fields:[new sap.m.Label({text: "bajls2"})]})
				})
			]
		}) ]
	}) ]
 })
Show 1 Share
10 |10000 characters needed characters left characters exceeded

can you check in developer tool if your form is taking full width of your screen?

can you remove the outer part to try again?

newsap.ui.layout.Grid({
    content:[newsap.m.VBox({
		items:[
0
Jun Wu Jan 31 at 05:49 PM
0

where is your code?

Share
10 |10000 characters needed characters left characters exceeded