Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Get a view element from another view

$
0
0

Hi

I was just wondering how to get reference to a view element from another view. I have couple of views in the Ui5 project, and from one view - I need to update other view element

 

view 1 -

 

var oImage = new sap.ui.commons.Image("idImageYard",{

press: 

function(oEvent){

       if(!oOverlayContainer.isOpen()){

                   oOverlayContainer.open();

                 }

} });

oImage.setSrc("images/"+propA+".jpg");

 

view 2 -

var image = sap.ui.getCore().byId("idImageYard");

image.setSrc("images/"+yardNo+".jpg");

 

 

this returns image object is undefined.

 

How do I get access to the view 1 element from view 2?

 

Thank you

Aakash


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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