Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9090

How to find the reference to a particular view when we need to modify the controls in that view from some other view ? What is the best way to achieve this?

$
0
0

I am using this.createID("") to generate ID for the elements/controls in my JSviews and using view.byID()  to reference them only problem is what is


the best way to get the reference for the "view". ?

 

for example

 

View1 has table control and we need to modify(apply filter) to that table control from the View 2's controller

 

the way I have handled this is

In View 2  I am declaring (or creating new instance for the view 1 )

 

 

var x = sap.ui.view (........params for view 1........ ); 

 


passing x to the function in controller of View 2

 


then using the below statement

 


x.byId("tableControlID").someMethodl();

 

 

 

this works but in a complicated scenario when there can be nested creation of new view instances it gives run time error

 

for example

 

View2 has new instance of view 1 and  View1 has new instance of View2 ( this leads to deadlock situation )

 

 

What is the best way to get reference to View1 without having to create new instance of it?

 

Regards,

Amit.


Viewing all articles
Browse latest Browse all 9090

Trending Articles