PDA

View Full Version : Collite buttons



GuS
Mar 26, 2008, 2:30 PM
Hi guys, i am having some problems with coolite buttons and trying to open a window, heres my code:



<!-- Contenido en Tabs con AJAX -->
<div id="tabs1">
<cool:TabPanel ID="TabPanel1" runat="server" ActiveTab="0" Height="300px"
Plain="True" BodyStyle="padding:10px" ButtonAlign="Center">
<Items>
<cool:Tab ID="Tab1" runat="server" Title="Instructivo">
<Content>
<p>En este apartado tendr&amp;aacute; una gu&amp;iacute;a instructiva para el usuario...</p>
</Content>
</cool:Tab>
<cool:Tab ID="Tab2" runat="server" Title="Reportes por Fecha" Width="300">
<Content>
<div id="tabsSearch1">
<table class="tabsSearchTable1" cellspacing="4" width="0%">
<tbody>
<tr align="left" valign="top"><td>
<asp:Label ID="searchLabel1" runat="server" Text="Fecha Inicial:"></asp:Label>
</td>
<td>
<cool:DatePicker ID="DatePicker1" runat="server"></cool:DatePicker>
</td></tr>
<tr align="left" valign="top"><td>
<asp:Label ID="Label1" runat="server" Text="Fecha Final:"></asp:Label>
</td>
<td>
<cool:DatePicker ID="DatePicker2" runat="server"></cool:DatePicker>
</td></tr>
<tr align="left" valign="top"><td></td><td>
<!-- <asp:Button ID="Button" runat="server" Text="Buscar" /> -->
<cool:Button ID="Button1" runat="server" Text="Buscar"></cool:Button>
</td></tr>
</tbody>
</table>


<cool:Window
ID="Window1"
Title="Resultados"
runat="server"
Width="550px"
Height="400px"
AutoShow="false"
CloseAction="Hide"
Collapsible="true"
TriggerElement="Button1"
AnimateTarget="Button1">
<Content>
<cool:Panel
ID="Panel1"
runat="server"
Title="Reportes por Fecha"
Height="400px"
BodyStyle="padding: 6px;"
AutoLoad="searchResult1.aspx"/>
</Content>
</cool:Window>
</Content>
</cool:Tab>


As you can see, i have the asp button cotrol commented cause with that button the window opens perfectly... but no with coolite button... why?
I am using lastest coolite 0.4.1

Cheers.

geoffrey.mcgill
Mar 26, 2008, 5:40 PM
Hi Gus,

Thanks for pointing out the bug. The problem was two "click" events were getting registered to the Button and the _PostBack event was firing before the TriggerEvent to show the window. I put a couple checks to prevent this from happening.

The code will be available with the next release.

Until then, you can work-around this bug by removing the TriggerElement property from Window, and then add a Click event handler to the cool:Button to show the window. This is actually exactly what happens behind the scenes, but is just handled automatically. Manually adding the Click event will produce the exact same results.

Example


<cool:Button ID="Button1" runat="server" Text="Buscar">
<ClientEvents>
<Click Handler="function(){Window1.show();}" />
</ClientEvents>
</cool:Button>

<cool:Window
ID="Window1"
runat="server"
CloseAction="Hide">
<Content>
Window 1
</Content>
</cool:Window>


Hope this helps

GuS
Mar 27, 2008, 12:58 PM
Thanks!! this solved the problem... indeed i hate asp.Net, but i offered my help in the Univ where i work to improve a site, which is made using asp .net... but like i am developer in other web and apps. languages (like Python and PyQt) it is not a problem for me to learn this.

Anyway, this Coolite it is a great implementation (of Ext Js) for asp.net.

Great Job!.


Cheers and again thanks for the quick response.