Search code examples
xmldynamicodatasapui5entityset

How to get a specific EntitySet dynamically in an UI5 XML-View?


Is there a way to pass a dynamic parameter to identify a specific EntitySet in a UI5 XML-View? I am using UI5 with ODataV2 and here is my XML of an UI5 Text Object:

<Tex text="{/ProductSet('AR')/ProductName}"/>

Note that the 'AR' is the Key of a specific EntitySet, it gives me the ProductName from a specific ProductSet.

But instead of hardcoding the Key, is there a way to pass it dynamically? Something like this for example:

<Tex text="{/ProductSet('{ProductKey}')/ProductName}"/> 


                        

Solution

  • You should use Property Binding or Element Binding from the controller. Here you can compose any path you like.