cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Context Binding Issue in Table for UI5 Application

Former Member
0 Likes
446

Hello Experts,

Need your help in understanding the context binding issue I am facing in UI5 demo application design.

1. I created on RFC Function Module to pull data for flight booking details as well Airline booking count.

2. Created oData using this FM and tested in GW Client, it seems OK.

3. There is a referential constraint like for one single Airline selection from Master page will display concerned booking information (1:N) in detail page.

Selecting record in master page gives the data in detail page but only the last record of booking information is being displayed.

Kindly see the below screen shot. Tried a lot but couldn't fix the issue. So if you can kindly help me in this regards.

I can find in debug the total booking record in internal table is as per the below screen shot

But is only displays the last record in series (1 --> 5362). Any idea on this?

Thanks , SL

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

The entityset that Table Header uses might not have an unique id. Have bookingId & customerId as key properties defined to that entityset.

Former Member
0 Likes

Thanks, how could I missed this !!! I took duplicate values as key

Answers (2)

Answers (2)

jamie_cawley
Product and Topic Expert
Product and Topic Expert
0 Likes

What binding are you using in the detail view table and what context are you setting the view to in the controller?  The table should be using the bookings collection for the table items aggregation.  The context should be setting the view to /flight('flightnumber').  Check the network tab of the browser dev console to confirm what is getting called.

Regards,

Jamie

SAP - Technology RIG

Former Member
0 Likes

Hello Jamie,

Here is the context information being passed to Detail View:

Here ExFdetails contains the information for Master View and the concerned selective element which is LH (Carrid) / (2402) Connid being passed to Detail view as key information.

Now system is picking the concerned booking details using this CARRID and CONNID. The result count is correct as per here 5362.

Now when it is being displayed in detail screen it is only rendering the last line in that result set.

Detail controller code snippet is as below:

sap.ui.controller("sap.ui5.sflight.zui5_sflight_book.Detail", {

onInit : function() {
// handle data loaded events
var oBus = new sap.ui.getCore().getEventBus();

oBus.subscribe("sflight_app", "ReadyToFetchDetails",
this.handleFetchDetails, this);
},

handleFetchDetails : function(sCannelID, sEvtId, oData) {

  alert("Next");

  var oContext = oData.oCtx;

  if (oContext) {

  // Bind object header to the OData model

  var oHeader = this.byId('header_flight');

  var sODataFilterPath = oContext.sPath + '/ExFlbookSet';

  oHeader.bindElement(sODataFilterPath);

  this.getView().setBindingContext(oContext);

  this.getView().byId("page_Detail").scrollTo(0);

}

},

Here ExFlbookSet will return the booking results.

Please advice.

Thanks , SL

jamie_cawley
Product and Topic Expert
Product and Topic Expert
0 Likes

How is the table defined?  It should be using the bookings collection for the table items aggregation.

Regards,

Jamie

SAP - Technology RIG

sanjoy0308
Active Participant
0 Likes

Hi,

Can you check in routing, what parameters are being passed to detail pattern. Please check showDetailItem method of master controller.

Regards,

Sanjoy