Search code examples
javascriptmobiletitaniumtitanium-alloy

Get current open Window on Titanium Alloy?


Is there a way to get the current open window?

In the controller is possible to use this.getView() to get that controller's relative view.

Since a controller can open any view in the project, I want not just know that controller's view, I want the top open (focused) view.


Solution

  • You access a view from it's accompanying controller by using $.getView(). If you want to access an item by id e.g. a TextField with id "myTextField" would be $.myTextField.

    If you want to know the current top focused view then you should know that from what your app is doing -- as the controller / view you just opened would be the top most view.

    Why do you need to know the top most view?