Skip to Content
0

Create UI element dynamically and display those UI in XML view

Mar 30, 2017 at 11:50 AM

63

avatar image

I am creating SAP UI5 application using XML view paradigm in eclipse:

I have created horizontal box like below in XML view

<HBox xmlns="sap.m" id="H34" busy="false" busyIndicatorDelay="1000"

visible="true" height="" width="100%" displayInline="false"

direction="Row" fitContainer="false" renderType="Div"

justifyContent="Start" alignItems="Stretch">

<tooltip></tooltip><!-- sap.ui.core.TooltipBase -->

<dependents></dependents><!-- sap.ui.core.Control, since 1.19 -->

<items>

Here need to show Input dynamically

</items><!-- sap.ui.core.Control -->

</HBox>

My requirement is to create Input field dynamically and display those fields under above XML view items( pointed in Bold).

Please help me out in this.

Regards

Vincent

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

2 Answers

Jun Wu Mar 30, 2017 at 12:27 PM
0

YOURHBOX =this.byId(hboxid)

YOURHBOX.addItem(YOURDYNAMICCONTROL)

Share
10 |10000 characters needed characters left characters exceeded
vincent balraj Mar 31, 2017 at 07:48 AM
0

I have added as per your suggestion as below in JS controller.

var hBox = this.getView().byId("H34");

item = hBox.addItem(new sap.m.Label("BBN", "Test label"));

Now, how i need to display this UI in XML view . It means, how can i call this UI element in XML view

Explain me with sample code

Thank you.

Vincent

Show 1 Share
10 |10000 characters needed characters left characters exceeded

don't know what u are talking....

0