cancel
Showing results for 
Search instead for 
Did you mean: 

Create UI element dynamically and display those UI in XML view

vincent_balraj3
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

vincent_balraj3
Explorer
0 Kudos

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

junwu
Active Contributor
0 Kudos

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

junwu
Active Contributor
0 Kudos

YOURHBOX =this.byId(hboxid)

YOURHBOX.addItem(YOURDYNAMICCONTROL)