Skip to Content
0

Label misalignment in Grid ComboBox

May 25, 2017 at 09:43 AM

73

avatar image
Former Member

Hello All,

Label is too high. I need to allign properly for the ComboBox. and ComboBox is also too away from Label (As mentioned in ScreenShot). Please help me Fix it.

Please find Attached code.

<mvc:View controllerName="Sapui5_cBox_label_allignment.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml"
	xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m" xmlns:l="sap.ui.layout">
	<App>
		<pages>
			<Page title="{i18n>title}">
				<content>
					<l:Grid defaultSpan="L3 M4 S6" class="sapUiSmallMarginTop">
		<l:content>
			<Label text="Combo" textAlign="Right"></Label>
			<ComboBox >
				
			</ComboBox>
		
			
		</l:content>
	</l:Grid>
				</content>
			</Page>
		</pages>
	</App>
</mvc:View>

Thanks and regards,

Urvish

label.png (10.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
VIPLOVE KHUSHALANI May 25, 2017 at 09:49 AM
1

Hi Urvish Vijay Panchal,

Can you just use simple forms instead. In that alignment is handled

https://sapui5.hana.ondemand.com/explored.html#/entity/sap.ui.layout.form.SimpleForm/samples

thanks

Viplove

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

HI Viplove Khushlani,

I have tried using forms. but issue with form is both label and comboBox is coming in center of the Page. My requirement is to display at left of the Page.

Thanks,

Urvish

0

Hi ,

Actually forms comes in the center of the parent container control .. you can use H layouts or HBox and make it on the left .. and also you can adjust the label span and span of different control accordingly.

thanks

Viplove

0
Former Member
VIPLOVE KHUSHALANI

Hi,

I have used <HBox> and It solved the distance problem with comboBox but alignment issue remains the same. It is still too high as mentioned in Screen shot.

Thanks,

Urvish

label1.png (19.1 kB)
0

If you use Controls in HBox than you need to provide the margins .. so use predefined SAP margin classes .. like sapUiTinyMarginTop as mention in the link below

https://sapui5.hana.ondemand.com/#docs/guide/777168ffe8324873973151dae2356d1c.html

thanks

Viplove

0
Former Member
VIPLOVE KHUSHALANI

Hey,

It solved the Issue.

Thanks,

Urvish

1