cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori My Leads controller extension

raina_goyal
Participant
0 Kudos

Hi Experts,

I am extending an SAP Fiori My Leads application following the SAP best practices.

I want to extend s3.controller.js in order to get the data for a custom tab that i have already implemented, but on debugging i found that no service is being invoked when i click the tab.

Kindly advice.

Thanks and Regards,

Raina Goyal

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

Hi Raina;

Do you see any console errors in the browser.

Please provide more details regarding the code you have written in the extension.

Where you are calling the service. Provide few screenshots also of the extended application for better understanding.

Regards,

Sarbjeet Singh

raina_goyal
Participant
0 Kudos

Hi Sarbjeet Singh,

No, there aren't any errors in the console in browser.

I am adding a new tab icon and wanted to show the sales organisational data. I am able to show the labels but the data isn't fetched from backend. The screen is below:

Also, when i debug after clicking this "Sales area " tab, it is not hitting backend and does not show any service.

Do i need to create a new entity set for it, as i have extended lead entity and it has the data.

Kindly advice.

Thanks and Regards

Raina

gill367
Active Contributor
0 Kudos

Hi Raina;

In S3 controller you will find a method selectedTab


selectedTab: function(oControlEvent) {

var oModel = this.oModel;

var tab_selection = oControlEvent.getSource().getSelectedKey();

var that = this;

this controller will call the backend odata on selecting a tab.

Please add the code for your tab also here and then implement a expand for the same in the backend.

Regards,

Sarbjeet Singh

raina_goyal
Participant
0 Kudos

Hi Sarbjeet Singh,

My custom controller code is as follow:

Where do i put this code?

Thanks and Regards

Raina

gill367
Active Contributor
0 Kudos

Hi Raina;

You are binding an empty model to the tab.

You need to fill it first with the data from the backend and bind it to the tab or view.

Regards,

Sarbjeet Singh

raina_goyal
Participant
0 Kudos

Hi Sarbjeet Singh,

Thank you.

Could you please tell me how to bind it?

When i write this.oModel.oData----> in console, it shows me the data. But how to bind it with json model?

Please suggest.

Thanks and Regards

Raina Goyal

gill367
Active Contributor

var oData_m = this.oModel.oData;

var tab = this.getView().byId("SalesAreaDetails");

var jsonModel = new sap.ui.model.json.JSONModel(oData_m);

tab.setModel(jsonModel, "json1");

Regards,

Sarbjeet Singh

Answers (1)

Answers (1)

raina_goyal
Participant
0 Kudos

Hi Sarbjeet Singh,

Thanks, it worked....

Thanks and Regards

Raina