Is it possible to get controller from binding context - sapui5

I have one controller, for which I'am binding context data. I have the context ID to get the binding context and want to get corresponding controller. Is it possible?

This is not possible as the binding context is not aware of the controller.

Related

How destroy (de-istantiate) or change reference for a xml view?

By this code I instantiate a xml-view and associate it to a name:
sap.ui.xmlview(welcomeApp, "apps.app1.welcomePage")
I want change set apps.app2.welcomePage to my new welcomePage xml view...
How can I destroy (de-istantiate) the view (after I re-istantiate it by the new path) or change the path?
You should use Routing to handle navigation from view to view. Please check out this step by step example to understanding UI5 routing mechanism.

Exposing an unbindable property to the ViewModel

I have a View with a LongListMultiSelector. My ViewModel needs to access the SelectedItems property which is not available for binding. Without exposing my View to my ViewModel, how do I expose it?
This other question from someone also trying to accomplish the same thing has the solution.

Setting segue destination controller properties only once?

Is there a way when using Storyboards to identify when a segue is called for the first time. I am using prepareForSegue:sender: to inject a pointer to my model into the segue destination controller, but I only want to do this when the controller is first created.
Currently I am checking the dataModel pointer in the destination controller and only setting it if it returns null. This works just fine, but I wanted to check I was not missing another way of accomplishing this?
there will be another solution by using your appdelegate
in the function :didfinishlaunching you can create a bool for the app and then check it if it is already called or not
hope this also helps..

State management in MVC 2

I want to show a Session Variable data on View.
How can i achieve it.
I am storing some data in Session varaibles and noew i want to display it on View please help me.
I am new Asp.Net MVC 2
Please suggest.
use the ViewData and pass it to the view
in your controller set up something like ViewData["namehere"] = value
then in your View you can call the value of Viewdata["name here"] - think of the ViewData as a bag that you can put properties and their values into and not need to explicitly pass the viewdata to the view for the view to use it
view data is just like session in asp.net so in your controller you can create more than one view data then create you view ,if you want to create a partial control for the view it will alse see the result of the view data but do not forget to cast the result.

IPHONE How to access variables from other classes/viewcontrollers

I have a app that uses several view controllers. In one instance I need to uses an int (int lives) in a seperate view controller from where it is created. I have tried using it and it throws and error at build claiming "lives" undeclared. I am already importing the view controller where the int was declared. I am stuck on this one.
I would appreciate any help.
Use properties, or custom setter and getter for instanse variables.
You could use the application delegate to store information you need in different places in you app.
The proper way would be to implement your own delegate protocol. For a recent discussion on this topic, see pass a variable up the navigation stack