Skip to Content

Create UI element dynamically and display those UI in XML view

Mar 30, 2017 at 11:50 AM


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 -->


Here need to show Input dynamically

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


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.



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

YOURHBOX =this.byId(hboxid)


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

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.


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

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