cancel
Showing results for 
Search instead for 
Did you mean: 

Bind to function import in XML view

carlonnheim
Participant
0 Kudos

Hi,

We are trying to bind a segment of an XML view to an oData v4 function import which returns a deep json structure, like this:

<FlexBox binding="{MyService.getMyData()}">
  <MessageStrip text="{SomeText}" />
  <List items="{SomeItems}">
    <!-- Some nested content -->
  </List>
</FlexBox>
<FlexBox binding="{MyService.getMyData()}"> <MessageStrip text="{SomeText}" /> <List items="{SomeItems}"> <!-- Some nested content --> </List></FlexBox>

the "getMyData" bound function returns something like this

{
  SomeText: "Hello World",
  SomeItems: [
    {Name: "Item 1", Value: "Value 1"},
    {Name: "Item 2", Value: "Value 2"}
  ]
}

We are not able to make this function call trigger and key into the resulting values. Is this scenario possible, if so how? Our workaround is otherwise to query the function from the controller and put the result in a local JSON model which is then bound to the view. This works, but seems unnecessarily complicated...

Thanks in advance!

//Carl

Accepted Solutions (0)

Answers (1)

Answers (1)

saurabh_v
Active Participant
0 Kudos

The documentation here OData V2 Model says that the ODataModel supports invoking function imports or actions by the callFunction method, so I'm not sure if the way you are trying will work.