views:

178

answers:

1

I have a modal dialog box presented in Yahoo UI. The user selects a value from dialog "A", and then I want to present another modal dialog box to collect some more data in dialog "B".

I have been using the YAHOO.widget.Dialog successfully. The problem seems to be that you can't initiate dialog window "B" from the handler function of dialog "A". So, how can you programmatically launch a second dialog window after the user hits the "OK" button on the first ?

(I had tried to create an additional Listener for a field that is updated in dialog "A" to trigger dialog "B" but this doesn't work either.)

Thanks..

A: 

Check out the documentation: http://developer.yahoo.com/yui/container/dialog/#events. The following code should do the trick:

var firstDialog = new YAHOO.widget.Dialog('firstDialog', { postmethod: "manual" });

firstDialog.manualSubmitEvent.subscribe(function (type, args) {

    var nextDialog = new YAHOO.widget.Dialog('nextDialog', {  });

    /* more configuration stuff... */

    nextDialog.render();
    nextDialog.show();

});

firstDialog.render();
firstDialog.show();

This handles when the form is to be submitted, which I think what you mean by selects a value, but if not let me know and I can give some help on that situation.

Bialecki
thanks for the pointer.. i never understood that "manualsubmitevent". YUI is quite powerful, but still needs more explicit doco.. will let you know
giulio