Selected window

I have a problem when I open more than one window form a page.



The action I do is that each time that I park Up a window I calculate the place where It has to be show I I show them on a row at the bottom of the page.



When I parkdown a page and i iterate the dhxWins after doing it my window object is pointing to the last window of this iteration.

Is there a way to give back the window I was using?



Thanks

Nerea



Here is my code:



winload.attachEvent(“onParkDown”, function(win) { //Al minimizar la ventana situar abajo                    

//Decrementar el contador de minimizadas

numpark = 0;

dhxWins.forEachWindow(function(winP) {



//si est� parked eliminamos los espacion entre las que quedan parked    

if ( (winP.getText() != win.getText()) && winP.isParked()){

    //colocar la venta en la posici�n parked

                            winP.setPosition( 200 * numpark, document.body.clientHeight - 37);

                            //Incrementar el contador de minimizadas

    numpark = ++numpark;                            

}    

});

win.setDimension(winWidth, winHeight);

win.center();

return winload;

});         



winload.attachEvent(“onParkUp”, function(win) { //al amaximizar ventana centrar

                    

//Incrementar el contador de minimizadas

numpark = ++numpark;                        

                    

win.setDimension(10, 0);

if (numpark == 1){

    win.setPosition( 0, document.body.clientHeight - 37);

}

else{

    win.setPosition( 200 * (numpark-1), document.body.clientHeight - 37);

}

return true;

});



Here is a demo.
(Do not forget about repositioning parked windows on close, this is not included in demo)

1.zip (1008 Bytes)


Thanks a lot!



It works ok.



I solved my other problem passing the window’s Id to the the next page to handle all its functions.