View Full Version : [CLOSED] Multiple Trigger in a Window

Aug 22, 2008, 4:57 PM

My question is: It is possible to add multiple triggers to ONE Window? Example.. I have like 3 search Buttons that each open a Window to show a search result into a GridView (currently I have 3 Windows, one per each Button).
So, is possible to add only One Window with triggers to those 3 buttons?


Aug 22, 2008, 5:30 PM
Hi Gus!

Yes, sure, you can do it.
Please see next example

<ext:Window runat="server" ID="Window1"></ext:Window>
<ext:Button runat="server" ID="Button1">
<Click Handler="{Window1}.show({Button1});" />
<ext:Button runat="server" ID="Button2">
<Click Handler="{Window1}.show({Button2});" />
<ext:Button runat="server" ID="Button3">
<Click Handler="{Window1}.show({Button3});" />

Let me explain syntax. The window has the 'show' js function. If you want to open the window then need to call this function. You can pass the trigger control (for animation) or just pass 'null' (without the quotes, of course). You can ask why need curly brackets. The client id's of control can be different from the server id's. When you wrapping to curly brackets the Coolite toolkit will change them to real id's

Please pay attention that in the next release (v0.6) syntax will be change, instead of {Window1} need to use # {Window1}

Sep 01, 2008, 4:05 PM

Thanks for the tip! That worked.
But now i have one problem and one question:

1st. I have problems using Coolite buttons (indeed since this version if i remember correctly). This error showed when i click on a Coolite button (no matter if i use triggers or not... even when i put only a button with no fuctions on it):


Now, this is on Firefox. In IE it shows the window (lets assume that i launch a window when pressing the button) and after a less than a second it closes and the browser shows "Error on Page" in the statusbar.

This is my code:

<ext:Button ID="SearchButton1" runat="server" Text="Buscar">
<Click Handler="{Window1}.show({SearchButton1});" />


Title="Reportes por Curso"
BodyStyle="padding: 6px;"

2nd. My question is, that now the window has no transision effect when i open it (since i use this trigger method). How i could do this?

Thanks in advance!


Sep 01, 2008, 5:19 PM
1st. Please see http://forums.ext.net/showthread.php?postid=1234.aspx

2nd. Try the following <Click> Handler

<Click Handler="{Window2}.show(this.el);" />

Please note, after the v0.6 release, the above code would change to the following syntax

<Click Handler="#{Window2}.show(this.el);" />

The only change is that the TokenID is now prefixed with a "#".

Hope this helps.

Sep 01, 2008, 8:24 PM

The animation (of the window) in my 2nd doubt/problem is solved, but the same error occurs with this. :(

Any other tip?


Sep 01, 2008, 8:40 PM
I'm not sure what you mean by "but the same error occurs with this"? Can you explain further?

Sep 01, 2008, 10:28 PM
I meant, with the solution you gave me... I press the button, the window appears and the error page came out.
Now, i've tested to delete the Autoload of the Window, and when i press the button, the window appears but it dissappear again after a second.


Sep 02, 2008, 4:39 PM
Hello Again!

I saw that the error (posted in the pastebin site) is caused by the AutoLoad when i use an aspx file in it.
Maybe i've made mistakes in that file? Posting the code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="searchResult.aspx.vb" Inherits="searchResult" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<form id="searchresult" runat="server">

<p>Aqu&amp;iacute; se posicionarķa la Tabla o Grid con el resultado de la b&amp;uacute;squeda...</p>
<asp:GridView ID="searchGrid1" runat="server" Height="56px" Width="550px"
AllowPaging="True" BorderStyle="Solid" AutoGenerateSelectButton="True">

<asp:GridView ID="searchGrid2" runat="server" Height="56px" Width="550px"
AllowPaging="True" BorderStyle="Solid" BorderWidth="1px">
<asp:Label ID="searchStatusLabel" runat="server" Width="550px" Height="48px"
BorderStyle="Solid" BorderWidth="1px"></asp:Label>


By the way, about the Coolite window being closed after pressing the button to show it, this behavior does not happen if i use an simple aspx button.

Thanks in advance for any tip/help.


Sep 02, 2008, 5:25 PM
Please set .AutoPostBack="false" on your <ext:Button>.

By default the <ext:Button> will do a postback when clicked, thereby refreshing the page.

Hope this helps.

Sep 02, 2008, 7:50 PM

Great! that solved the problem, even the error on aspx page AutoLoad :D

Thanks Geoffrey! and sorry for newbie questions... I am not much aspx developer or so... (i develop more GUI apps). And i have low js practice and less about Ext JS/Coolite.


Sep 03, 2008, 2:14 PM
Hi again!

A small detail and question: what if i need the AutoPostBack for the button (for the form data)? It is normal that the Window closes if i not set the AutoPostBack to True?


Sep 07, 2008, 8:31 AM
Hi Gus,

Currently the <ext:Window> does not maintain show/hide state or positioning between postbacks. This is a feature we're hoping to introduce in a future version. 

You might want to investigate using the <AjaxEvents> for form submission. When the Page is submitted using an <AjaxEvent> the Window will maintain it's show/hide status and positioning.

Hope this helps.