Ready Form to be able to receive onReturn event

I have a window with a form that opens another window with a form by the press of a button, after a button is pressed on the second form the second window closes. How do I unfocus or put the first window in such a state, that it can receive onReturn event? As it is now, the first window does not receive onReturn until I press anywhere on the form where there are no controls. The goal is to indicate with return, that the form is done and can be closed.

Sorry I meant onEnter event not onReturn.

Hi

if I correctly understood:

winA + formA => formA button click (buttonId, see below) => winB + formB => formB button click/onEnter event => winB close => winA active but formA do not have focus

winB.attachEvent("onClose", function(){ window.setTimeout(function(){ formA.setItemFocus(buttonId); }); return true; // allow close });

Something like this, as mentioned the onEnter event on the first window is on recognized when I click anywhere on the window after either of the 2 secondary windows has closed, it is like the form/window does not automatically regain focus, the on. I have attached the event on the form, not sure if I should attach it on any other object, like the window itself. I just need some way of indicating in a convenient manner, that the form is done successfully and copy values to the underlying grid.

    var TimeWin = moUI.dhxWins.createWindow(sWindowID, x - 25, y + 10, 200, 200);
    var oTimeForm = moUI.dhxWins.window(sWindowID).attachForm(jsonObj);

    oTimeForm.attachEvent("onButtonClick", function (sID) {
            case "HOUR":
                var sWindowID = "Hourwindow" + sColumnID + CreateGUID();
                moUI.dhxWins.createWindow(sWindowID, x - 25, y + 42, 200, 158);
                var oForm = moUI.dhxWins.window(sWindowID).attachForm(jsonObj1);
                oForm.attachEvent("onEnter", function (sID) {
                    moUI.dhxWins.window(sWindowID).close();
                });
                oForm.attachEvent("onButtonClick", function (sID) {
                    oTimeForm.setItemLabel("Hour", sID);
                    moUI.dhxWins.window(sWindowID).close();
                });
            case "MINUTE":
                var sWindowID = "Minutewindow" + sColumnID + CreateGUID();
                moUI.dhxWins.createWindow(sWindowID, x - 25, y + 42, 200, 158);
                var oForm = moUI.dhxWins.window(sWindowID).attachForm(jsonObj2);
                oForm.attachEvent("onEnter", function (sID) {
                    moUI.dhxWins.window(sWindowID).close();
                });
                oForm.attachEvent("onButtonClick", function (sID) {
                    oTimeForm.setItemLabel("Minute", sID);
                    moUI.dhxWins.window(sWindowID).close();
                });
   });
    oTimeForm.attachEvent("onEnter", function (sID) {
        oGrid.cells(sRowID, nColIndex).setValue(oTimeForm.getItemLabel("Hour") + ":" + oTimeForm.getItemLabel("Minute"));
        moUI.dhxWins.window(sWindowID).close();
    });

Hi

please provide completed demo including all corresponding js/css files and some words how to reproduce. you can send demo by email support@dhtmlx.com