cancel
Showing results for 
Search instead for 
Did you mean: 

How to display one field as 1 column and other fields in SimpleForm divided into 2 Columns?

former_member567509
Participant
4,527

Hello,

Is there a way to display one input field as a single column and rest of fields divided into 2 columns in SimpleForm. Currently i have used two form; one having one column and another form having 2 columns.

Can i achieve the same with just one form?

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

himanshupensia
Participant

Hi Deepak,

You can achieve above functionality by dividing Simple forms into columns.

Here I have divided the Simple form into three columns. You can enter yours fields column vise here.

<mvc:View controllerName="Demo.controller.View1" xmlns:viz="sap.viz.ui5.controls" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:viz.feeds="sap.viz.ui5.controls.common.feeds"
    xmlns:viz.data="sap.viz.ui5.data"  xmlns:mvc="sap.ui.core.mvc"  xmlns:layout="sap.ui.layout" 
displayBlock="true" xmlns:f="sap.ui.layout.form" xmlns="sap.m" xmlns:core="sap.ui.core">
<App>
<pages>
<Page title="Demo for Simple Form">
<content>
<f:SimpleForm maxContainerCols="3"  editable="true" layout="ResponsiveGridLayout" labelSpanL="5" labelSpanM="5" emptySpanL="0" emptySpanM="0" columnsL="3" columnsM="3">
<f:content>

<core:Title text="First Column"/>
//fields for first column goes here.
<core:Title text="Second Column"/>
//fields for second column goes here
<core:Title text="Third Column"/>
//fields for third column goes here

</f:content>
</f:SimpleForm>
</content>
</Page>
</pages>
</App>
</mvc:View>

former_member679019
Participant
0 Kudos

Not a helpful answer. Original poster already knows this, what he wants is a particular control to be able to take up 2 columns while other controls only take up 1.

I'm looking for a solution to this problem as well

maheshpalavalli
Active Contributor
0 Kudos

There you go..

You can find the code here Link

	<Label text="Street/No." />
				<Input value="{Street}">
				</Input>
				<Input value="{HouseNumber}">
					<layoutData>
				          <l:GridData span="XL1 L2 M2 S4" /> // this determines the 2nd input box span
					</layoutData>
				</Input>
former_member567509
Participant

Thanks for your answer Mahesh.

But i have many fields in the form so i have used the span parameter and columns parameter of form itself to align the form elements in two columns but i want is first column shows up in entire row and other controls divided in 2 columns.

i hope i could make my question clear.

thanks.

dhiraj_jaiswal
Advisor
Advisor
0 Kudos

Hi Deepak,

Were you able to find solution to this problem? I'm also facing the same issue where I'm hiding few fields but input box size is getting reduced. Can anyone help ?

dhiraj_jaiswal
Advisor
Advisor
0 Kudos

d.saini