Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion to add passing values to windows #1

Open
max1020 opened this issue Jun 15, 2017 · 0 comments
Open

Suggestion to add passing values to windows #1

max1020 opened this issue Jun 15, 2017 · 0 comments

Comments

@max1020
Copy link

max1020 commented Jun 15, 2017

Often you need to pass a value from one window to the other (e.g. getting the id in a master listview to open the details page of the item.)

In index.js one can easily to this:

Alloy.Globals.UI.openWindow = function(winName, arg) {
$.root.activeTab.open(Alloy.createController(winName, arg).getView());
};

In windowsA1.js for instance (passing a value to windowsA2):

function openWinA2(e) {
Alloy.Globals.UI.openWindow('windowA2', {nid: "12"});
}

windowsA2.js:

var args = arguments[0] || {};
console.log("args.nid: " + args.nid); //results in "12"

Thanks for this very useful contribution.

@max1020 max1020 changed the title Suggestion to add Suggestion to add passing values to windows Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant