cancel
Showing results for 
Search instead for 
Did you mean: 

Data binding to UI controls

0 Kudos

hello

am still trying to get my hand around this data binding concept.

in my app I have a trip entity and an associated flight entity. For a selected trip how do I get the associated flight entity so I can set corresponding union trolls in the detail view. I have defined nav and associations in my EDMX file.

THanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi

my mockdata for flight is like this.

{

  "TripID": "TripID 1",

  "FlightConfNo": "FlightConfNo 1",

  "FlightNo": "FlightNo 1",

  "FlightName": "FlightName 1",

  "FromCity": "FromCity 1",

  "ToCity": "ToCity 1",

  "DepartAt": "/Date(1376231869000)/",

  "ArriveAt": "/Date(1455464269000)/",

  "FlightCost": "FlightCost 1",

  "CurrencyCode": "CurrencyCode 1",

  "__metadata": {

  "uri": "FlightSet(TripID='TripID 1',FlightConfNo='FlightConfNo 1')",

  "type": "/IWBEP/GWSAMPLE_BASIC.Flight"

  },

  "ToFlight": {

  "__deferred": {

  "uri": "FlightSet(TripID='TripID 1',FlightConfNo='FlightConfNo 1')/ToFlight"

  }

  }

Now the trip details are displayed in the header and overview tab.

I want flight, rental etc to show up as feed list items in second icon tab.

This is the code snippet from the Detail view

  <FeedListItem items="{ path : '/Flight' , parameters : {expand:'Trip'} }" counter="0" icon="sap-icon://flight" sender="Flight" text="{FlightName}" >

The flightname does not appear. What am i doing wrong?

Thanks

former_member185414
Active Contributor
0 Kudos

Hello Meera,

Try like this -

  <FeedListItem items="{ path : '/FlightSet' , parameters : {expand:'ToFlight'} }" counter="0" icon="sap-icon://flight" sender="Flight" text="{FlightName}" >


BR.

former_member182862
Active Contributor
0 Kudos

Hi Meera

Please use this as a reference

SAPUI5 Explored

You do not have the path in the FeedListItem but you need a List as a container.

Thanks

-D

Former Member
0 Kudos

Hi,

By using your navigation property in one of these ways:

  1. by $expand query option
    assuming the following URL:

    http://your.server/your_odata_endpoint/your_trip_entity_set?$expand=your_navproperty_to_flights
    which lists your trips and you will get the flight info inline

  2. by adding /<your_navproperty> to your entity endpoint:

    http://your.server/your_odata_endpoint/your_trip_entity_set/your_navproperty_to_flights
    and you will only get the flights

Greetz Silvio