Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8150

Can't access object created in the view from controller

$
0
0

Hi

 

In the view, I create a simple HTML control with a DIV tag.I need to access the DIV tag from the view.  The function this.getView().byId() returns nothing.

 

view

createContent : function(oController) {                        var aControls = [];                        var html = new sap.ui.core.HTML(                                {                                    content : "<div id='obj1' style='width: 300px; height: 200px;'></div>"                                });                        aControls.push(html);                        return aControls;                    }

 

controller

 




onInit: function() {

  
this.getView().byId("obj1");    },

 

Thanks.


Viewing all articles
Browse latest Browse all 8150

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>