Re: [qooxdoo-devel] Modal Window Affects Parent Window
Brought to you by:
ecker,
martinwittemann
From: Derrell L. <der...@un...> - 2011-05-05 03:24:03
|
On Wed, May 4, 2011 at 22:47, Benjamin Turner <bpl...@gm...> wrote: > Hello, > > I'm sort of stuck. I'm creating a modal window from another window. > Inside this modal window, it will have say a text box where you can input > the string. After they click "OK" on this modal window with the string, I > want it to modify the parent window that it was created from. How can I do > this? > Here's one possible solution. Presumably, the parent window created the modal window, so has a reference to it. Before opening the modal window, the parent can do: // Save the label object where the string will be placed modalWindow.setUserData("parentField", myLabel); The modal window can then, when it gets its "close" event, modify the parent: // "this" is the modal window this.addListener("close", function(e) { // Get the parent field to which we want to set the modal window-obtained string var parentField = this.getUserData("parentField"); // Get the value from the text field in the modal window var string = textField.getValue(); // Set the parent field with the string value parentField.setValue(string); }); There are many other implementations to do the same thing, but this should give you some ideas. Derrell |