Binding data from Odata function Import in SAPUI5 XML Views
Hi all,
Recently I had an requirement, wherein, I had to bind the data from my function imports in odata services to my controls in XML view.
However, most of the solutions i found had achieved the same by doing a “oModel.callFunction()” in their controllers.
I was able to find a solution and thought I would share it in a blog post here.
Here is the sample code
<MultiComboBox items="{ path:'/myFunctionImport', parameters: { custom: { 'param1': '\'value1\'' } } }">
<core:Item key="{Id}" text="{Text}"/>
</MultiComboBox>
Thanks,
Krishna
Hello Krishna,
Thank you to sharing the information, could you please give more details? how you can set values of your parameters from controller to XML?
Many Thanks,
Kalthoum.
Hello Krishna,
I would like to ask you that if it possibile to use a binded field instead of theĀ '\'value1\''.
Let me explain this via my example:
in my detail.controller I use bindElement to bind an object to the dialog:
in the dialog fragment I want to call a function import using the {TrainingId} paramater which is one property of the binded Object (above in the detail.controller):
In tihs case the GET request looks like this:
GetUsersofTraining?$skip=0&$top=100&$orderby=UserId asc&TrainingId='{TrainingId}'
and I don't get any data.
Do you have any advice, how can I do this in a right way?
Many thanks,
Laszlo