<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" version="2.0">
  <channel>
    <title>Recent Posts in 'onBeforeClose or similar?' | Prototype UI</title>
    <link>http://forums.prototype-ui.com/forums/2/topics/147</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <atom:link rel="search" type="application/opensearchdescription+xml" href="http://forums.prototype-ui.com/open_search.xml"/>
    <description></description>
    <item>
      <title>onBeforeClose or similar? replied by alabastida @ Thu, 05 Jun 2008 23:35:34 -0000</title>
      <description>&lt;p&gt;Thanks!! That gave an idea on how to do it, but i tried like that and didnt worked, but it worked in this way:&lt;br /&gt;&lt;pre&gt;
var  win = new UI.Window({
            theme: "leopard",
            width: 300,
            height: 350,
            top: $j('body').scrollTop() + 25+ chat.position,
            left: Position.GetWindowSize().width/2 - chat.ancho/2 + chat.position,
            id:"win_"+folio,
            shadow:true,
            resizable: true,
            draggable:true,
            close:function(){
                stId    = this.id;
                var nickname = "";
                inId    = stId.indexOf("_") + 1;
                idFolio = stId.substring(inId,10);
                for (i=0;i&amp;lt;chat.usrConv.length;i++){
                    if(chat.usrConv[i][0] == idFolio){
                        nickname = chat.usrConv[i][1];
                    }
                }
&lt;/pre&gt;&lt;/p&gt;


	&lt;p&gt;Worked like a charm :)&lt;/p&gt;


	&lt;p&gt;Regards!&lt;br /&gt;Adrian&lt;/p&gt;</description>
      <pubDate>Thu, 05 Jun 2008 23:35:34 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:2:147:474</guid>
      <author>alabastida</author>
      <link>http://forums.prototype-ui.com/forums/2/topics/147</link>
    </item>
    <item>
      <title>onBeforeClose or similar? replied by seb @ Fri, 30 May 2008 08:24:18 -0000</title>
      <description>&lt;p&gt;Observing destroyed is too late. You need to set a custom close callback to do it.&lt;br /&gt;(not tested code)&lt;br /&gt;&lt;pre&gt;
UI.Window.addMethods({
  your_close_function: function() {
     if(confirm(&#8220;are you sure you want to close this window?&#8221;))
       this.destroy()
  }
});
new UI.Window({close: your_close_function});
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 30 May 2008 08:24:18 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:2:147:454</guid>
      <author>seb</author>
      <link>http://forums.prototype-ui.com/forums/2/topics/147</link>
    </item>
    <item>
      <title>onBeforeClose or similar? replied by alabastida @ Wed, 28 May 2008 00:06:32 -0000</title>
      <description>&lt;p&gt;Just an update.&lt;/p&gt;


	&lt;p&gt;I tried this:&lt;/p&gt;


	&lt;p&gt;win.observe(&amp;#8220;destroyed&amp;#8221;, function() {
            if(confirm(&amp;#8220;are you sure you want to close this window?&amp;#8221;)){
                event.continueProcess();
            } else {
                this.show();
            }
        });&lt;/p&gt;


	&lt;p&gt;And it works, if i select Cancel in the confirm, it shows the window back with internal functionality Ok, but, the problem is that the window controls dont work(minimize, maximize and close).&lt;/p&gt;


	&lt;p&gt;Any suggestion on this?&lt;/p&gt;


	&lt;p&gt;Thanks!&lt;br /&gt;Adrian&lt;/p&gt;</description>
      <pubDate>Wed, 28 May 2008 00:06:32 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:2:147:446</guid>
      <author>alabastida</author>
      <link>http://forums.prototype-ui.com/forums/2/topics/147</link>
    </item>
    <item>
      <title>onBeforeClose or similar? replied by alabastida @ Tue, 27 May 2008 23:21:39 -0000</title>
      <description>&lt;p&gt;Hello&amp;#8230; im testing the window object and is awesome !! but i have this question&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Is there a way to control the closing of a window?&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;say that if a user clicks on the close button, then a confirm box will show asking if they truly want to close it or keep it, and then fires the selected event.&lt;/p&gt;


	&lt;p&gt;Any guidance on this one please?&lt;/p&gt;


	&lt;p&gt;Thanks!!!&lt;br /&gt;Adrian&lt;/p&gt;</description>
      <pubDate>Tue, 27 May 2008 23:21:39 -0000</pubDate>
      <guid isPermaLink="false">forums.prototype-ui.com:2:147:445</guid>
      <author>alabastida</author>
      <link>http://forums.prototype-ui.com/forums/2/topics/147</link>
    </item>
  </channel>
</rss>
