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

sap.ui.generic.app.AppComponent init not working

sakthi90
Explorer
0 Likes
2,259

Hi all,

I am facing an issue reading the fiori tile parameters(not target mapping parameters) in an annotation based UI5 application.

For example I m keeping the parameter name as "param1".

By default UI5 template has chosen sap.ui.generic.app.AppComponent component for annotaion based development.

Initially I have kept the parameters in target mapping of the fiori tile. Then I was able to read the parameter in the controller init itself by using below code:

var param1= jQuery.sap.getUriParameters().get("param1");

Now I am in a situation to keep the parameter in "fiori tile parameter" section like this: param1=TEST . This parameter we can read through Component.js only.

sap.ui.generic.app.AppComponent.extend("abc.Component", {


init: function() {

var urlParam = {};

var oComponentData = this.getComponentData();

oComponentData.startupParameters.param1;

}

});

But this init is not getting called. When I replace sap.ui.generic.app.AppComponent with

sap.ui.core.UIComponent, init is getting called and param1 is getting read. But annotations are not working. Kindly suggest a solution.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Sakthi,

I was not able to hook into the init-method in a generic app lifecycle as well. But onBeforeRendering is called, which worked in my case. Maybe this is a workaround for you, too.

Best regards,

Christian.

sakthi90
Explorer
0 Likes

Hi Christian,

It worked 😄 Thank you so much

andretusch
Product and Topic Expert
Product and Topic Expert
0 Likes
Thank you Christian, that also helped me - where did you find this information?

Answers (0)