cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori app - Select the first line item in split app view by default

PavelPenaz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear experts,

Could you please advise the recommended way to select the first line in Split App view on launch of Fiori app by default?

The steps I took:

1. Created a custom Fiori app as per the guide here (using Split App view): http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8022ac87-1f60-3110-5383-fa68a91d7...

2. All works nicely with one exception. On subsequent launch of the Fiori app, I want the first line to be selected already, so that the Detail view is populated with the details of the first line item by default

Can anyone please advise how to go around doing that?

Thanks in advance.

Pavel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pavel,

Normally when you load the master view you can use the onInit method to wait for the list to be loaded and then select the first line. The problem is that the list is not available because of the loading of the components. I used the following code:

this.getView().byId("list").attachEventOnce("updateFinished", function(oEvent) {

  jQuery.when(this.oUpdateFinishedDeferred).then(jQuery.proxy(function() {

     this.selectDetail();

  }, this));  this.oUpdateFinishedDeferred.resolve();

}, this);

Greetings

former_member190313
Active Participant
0 Kudos

Hi Nick,

Could you please tell me where have you added this code?

Regards,

Sheetal

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Pavel,

Can you explain to me where you added the code?

A little explanation on the code itself would also be helpful.

I am getting the error in Developer Tools when I added the code snippet in Master Controller

Uncaught TypeError: Cannot read property 'attachEventOnce' of undefined

--

Regards

SAurabha J