on 02-13-2015 4:09 PM
Hello,
I am using fusioncharts in my project. In one of the scenario of drilldown charts I get a call to controller from fusioncharts where I have to show a popup.
I am able to bring up the popup but I get error while executing this.getView().addDependent(oPersonalizationDialog);
Error is because 'this' refers to different context and not able to get the view.
How to access the view in this scenario?
Thanks,
Rashmi
Hi Rashmi,
sometimes when "this" is not what you think, you can still get the "this" you want quite easily
Maybe you have your code line in the view controller, but in a anonymous function, at that moment "this" is different. Still you can pass the outer "this" to the inner anonymous function via
var that = this;
and in your anonymus function just access that.getView()...
(the closure concept)
Or you could bind the context to your function via jQuery.proxy( yourfunction, this).
Then the this in the function is the one you expect,
maybe this helps a bit, Sophie.
Ps: what was the main reason to use Fusion charts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rashmi,
How about using the sap.m.Popover to achieve your requirement.
Look at - SAPUI5 Explored
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rashmi,
the this keyword would have a different context depending if you use it in the view or in the controller in an event. you could access the view by using sap.ui.view(path.to.viewName)
this will solve your issue..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rashmi,
Can you try below way for instantiating view, if not tried before:
Methods Controlling the Initial Instantiation
if you are following the first link, have your code like below:
var myView; //declare this at the top (global var)
if(!myView){
//code for view instantiating
}
Thanks, MS
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.