cancel
Showing results for 
Search instead for 
Did you mean: 

Error While calling onAfterRendering() of sap.m.TileContainer via child class( Custom Tile Container)

Former Member
0 Kudos

Hi Experts, I'm trying to call onAfterRendering() Method of sap.m.TileContainer from one of the custom Tile Container which I have created by extending sap.m.TileContainer.

syntax being used is

sap.m.TileContainer.prototype.onAfterRendering().apply(this, arguments);

sap.m.TileContainer.prototype.onAfterRendering().call(this);

sap.m.TileContainer.prototype.onAfterRendering().bind(this);



this.getDomRef() and this.getId() is not being evaluated in onAfterRendering of sap.m.TileContainer, it is evaluated to be null, However 'this' object is available here.



Thanks in Advance!!

Accepted Solutions (0)

Answers (2)

Answers (2)

antonette_oberholster
Active Contributor
0 Kudos

Hallo Ravi

onAfterRender does not exist for TileContainer, see API doc

https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.m.TileContainer.html

Regards

Antonette

Former Member
0 Kudos

onAfterRendering of custom Tile Container

onAfterRendering : function() {

        

sap.m.TileContainer.prototype.onAfterRendering().apply(this, arguments);

sap.m.TileContainer.prototype.onAfterRendering().call(this);

sap.m.TileContainer.prototype.onAfterRendering().bind(this);

         

   

     },

former_member182862
Active Contributor
0 Kudos

it is good to add some code to check if the onAfterRendering method exist

onAfterRendering: function() {
    if (sap.m.TileContainer.prototype.onAfterRendering) {
        sap.m.TileContainer.prototype.onAfterRendering().apply(this, arguments);
    }
    //add your code
}

Thanks

-D

Former Member
0 Kudos

Hi Dennis,

Thanks for your time,

I want to highlight that i m able to navigate to onafterrendering method of sap.m.TileContainer but this.getId is being evaluated null here so onAfterRendering method is running into exception. However I have 'this' object populated in sap.m.TileContainer.

former_member182862
Active Contributor
0 Kudos

Sorry I made an mistake

onAfterRendering: function() {
    if (sap.m.TileContainer.prototype.onAfterRendering) {
        sap.m.TileContainer.prototype.onAfterRendering.apply(this, arguments);
    }
    //add your code
}

Here is an example

JS Bin - Collaborative JavaScript Debugging

Thanks

-D