How to work the close button of window widget ??

How it works the close button of window widget? He just hides the window? It is possible to hide the window, remove it from memory and reopen it again without the debugger deliver the following message: "Build: Multiple ID occurrence:"window_ID"?

regards,

RE: How to work the close button of window widget ??

Yes, close just hides the window (sets CSS class .btl-window-closed {display:none} on window)

If you close a window that has an id and then create a new window with the same id you will get the error message. Even removing the window (for example with bb.document.removeChild) will leave a reference to the window's id in the model and controler... and you will get the error message.

I had the same problem and solved it by overriding the window close method so that it destroys the window, like this:

<?xml version="1.0" encoding="UTF-8"?>
<d:tdl xmlns="http://www.w3.org/1999/xhtml"
        xmlns:d="http://www.backbase.com/2006/tdl"
        xmlns:b="http://www.backbase.com/2006/btl">

       
        <d:namespace name="http://www.backbase.com/2006/btl">
                <d:uses element="window" src="/Backbase/4_1_2/bindings/www.backbase.com.2006.btl/window/windowBase.xml" />
               
               <e:element name="window" extends="b:window">
                        <d:method name="close">
                                <d:body type="text/javascript">
                                        bb.command.destroy(this);
                                </d:body>
                        </d:method>
                </d:element>
        </d:namespace>
</d:tdl>

RE: How to work the close button of window widget ??

It's work fine, but i want kill a specific window in windowArea/taskBar widget, do you know how i can do this ??

kill a specific window

If it is the active window, get a window reference to it from windowArea/property::activeWindow

If it is not the active window, loop through windowArea/property::windows until you find a window that matches some identifying criteria.

Once you have the window reference, just call close method.

Great! I was looking for a

Great! I was looking for a way to destroy a window on close by default.
But I'mm using Backbase 4.2.0 and I'm getting an error when a window is destroyed...

Execution: Invalid method context, method "getAttribute" was called on a node which has been destroyed..

The error doesn't seem to have any influence on the application's integrity.

destroy window in BB 4.2

BB 4.2 has a small buglet. The TDL code for 4.2 looks like this:

<d:tdl xmlns="http://www.w3.org/1999/xhtml"
     xmlns:d="http://www.backbase.com/2006/tdl"
     xmlns:b="http://www.backbase.com/2006/btl">

               
     <d:namespace name="http://www.backbase.com/2006/btl">
          <d:uses element="window" src="/Backbase/4_2_0/bindings/www.backbase.com.2006.btl/window/windowBase.xml" />
               
          <d:element name="window" extends="b:window">
               <!-- this prevents "setAttribute called on a node which has been destroyed" bug when closing windows -->
               <d:handler event="click" type="text/javascript">
                    if (this.modelNode == null) { return }
               </d:handler>
                               
               <d:method name="close">
                    <d:body type="text/javascript">
                         // following is an alternative to the use of click handler above
                         //setTimeout(function(theWindow){bb.command.destroy(theWindow)},10,this);  
                         bb.command.destroy(this)
                    </d:body>
               </d:method>
          </d:element>
     </d:namespace>
</d:tdl>

Thanks a lot! Works like a

Thanks a lot! Works like a charm .