##
win.setExecBeforeSubmit()

    function f(w) {
        // w takes the value of w1 or w2, according to which
        // window called the function before submitting all of its serverFrames
    }
    w1.setExecBeforeSubmit(f)
    w2.setExecBeforeSubmit(f)

This method is called before a window submits all its serverFrames with the win method "submit()". By default, the "showLed()" method of that window is called, i.e. the leftmost button turns red. Note that when you redefine this function, the button won't turn red any more, unless you specify this explicitly in the function.