Thursday, 25 August 2016
Naming your Models in UI5
Once again, I'm indebted to the ABAP community for their generosity of spirit and sharing. This post explains really succinctly how you can mix and mash up your models by naming them as you set them.
http://scn.sap.com/thread/3948723
The biggest learning point for me was that the setModel method, which I'd thought indicated "Set the Model for the View" (i.e. you can only have one...)
this.getView().setModel(oSTModel,"TableModel")
Actually you can do this multiple times, setting several Models against the view. This is great, as we're now at the point where we need to draw data from several different places, and have them consolidated on the front end.
The named models can then be referred to by the XML view :
<core:ListItem text="{TableModel>Description}" additionalText="{TableModel>Key}" />
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment