I looked through the dialogue functions and found a way to do exactly what you want! The API documentation is not entirely clear, I had to try ...
Code example
In the main window:
In config.html :
Description
So ... In the main window, you create a dialog box with Ti.UI.showDialog and pass it a callback ( params.onclose , see above). In the dialog box, as soon as the user has set his configuration parameters via the html interface, you can simply save the configuration data in the object and pass it to the window closing method, and it will be passed to the callback in the main window.
Notes
Ti.UI.showDialog actually calls Ti.UI.createWindow and returns a Ti.UI.UserWindow object with some added fields and methods related to the dialog parameters, the result, and the closed callback.
Dialog parameters passed using Ti.UI.showDialog({url:"...",parameters:{...}}) can be accessed from the dialog using Ti.UI.getCurrentWindow().getDialogParameter("name") or Ti.UI.getCurrentWindow()._dialogParameters["name"] .
source share