Add a New Item to a Table / List

Bind the collection of data to the <items> aggregation of table. Add a new entry to the model (instead of to the UI directly) when the user clicks on Add. Thanks to the aggregation binding, UI5 will create a new ColumnListItem for you and you did not break the MVC pattern. Here are some examples, … Read more

getBindingContext() returns undefined

getBindingContext(sModelName?) Get the binding context of this object for the given model name. If the object does not have a binding context set on itself and has no own Model set, it will use the first binding context defined in its parent hierarchy. You have given name to the model (this.setModel(oModel, “myModel”)). Specify the model … Read more

Global Model Not Accesible

Avoid setting models on the Core directly if you’re using Components. Components are meant to be independent and reusable parts and therefore will not inherit the Core models by default. Models should be set depending on your business case: Models declared in the app descriptor (manifest.json) section /sap.ui5/models will be set on the Component. They … Read more

How to Access Elements from XML Fragment by ID

Accessing controls inside a fragment depends on how your fragment was created in the first place. Here is a list of cases with respective API to use to get the control reference. Given: this as a reference to the current controller instance Fragment required from the module sap/ui/core/Fragment <MyControl id=”controlId”/> in the fragment definition API … Read more

How to add country drop down using openUI5 [closed]

Well it seems like you’ve tried nothing to solve your problem, but I’ll give it a shot anyway. You need a list of countries, preferably in a non-human readable format (JSON). You can find such lists via google (list of countries json). You then use this JSON list to create a new sap.ui.model.json.JSONModel. After that, … Read more