Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Change position of textView to left side of textField

1. I've the following code and I want that the textView (label) will be on the left side of the textField,how should I do that? Currently its above...

2. there is nicer way to write the addConent instead what I did below (at the end of the code when I add the 3 controls...)

var oGrid = new sap.ui.layout.Grid("hLayout1");
var oTV = new sap.ui.commons.TextView({
id: 'Parent',
text: 'Title',
//design: sap.ui.commons.TextViewDesign.Bold
layoutData:new sap.ui.layout.GridData({span: "L2 M12 S12"})
});

var oTV2 = new sap.ui.commons.TextView({
id: 'Parent1',
text: 'label',
//design: sap.ui.commons.TextViewDesign.Bold
    layoutData:new sap.ui.layout.GridData({span: "L2 M12 S12"})
});

var oTV3 = new sap.ui.commons.TextField({
id: 'Parent2',
text:"textField"
//design: sap.ui.commons.TextViewDesign.Bold
layoutData:new sap.ui.layout.GridData({span: "L2 M12 S12"})
});
oGrid.addContent(oTV);
oGrid.addContent(oTV2);
oGrid.addContent(oTV3);
Tags:
Former Member
Former Member replied

HI Stephane

is this what you wanted?

Example

Thanks

-D

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question