[FIXED] Button does not show if AutoPost set to false...

  1. #1

    [FIXED] Button does not show if AutoPost set to false...

    Hi,

    I'd like to thank the Coolite team for giving us a great project. I've been fascinated with the Ext JS for a long time now but could never use it in my projects because of my inexperience in javascript.

    I hope to use this library, but since it is missing a lot of controls from the Ext JS (datagrid mainly!), I have decided to wait for another release or so before I can get to use it.

    But in the mean time I have also decided to work on a few demos to familiarize myself with the library and, these demos could also help me convince my boss to use the library. Anyways, as I am doing this, I will keep posting any bugs. Here is the first one from me:

    The button control does not show up on the page if AutoPost is set to false!!!

            <cool:Button ID="Button1" runat="server" AutoPostBack="False" Text="Show Window">
            </cool:Button>
    I am running windows vista and testing the app on Mozilla Firefox v2.0.0.13
  2. #2

    RE: [FIXED] Button does not show if AutoPost set to false...

    Hi there,

    Thanks for reporting the bug. The button was not redering because a JavaScript error was generated when the AutoPostBack property is set to "false". In general, if a JavaScript error is thrown, the coolite/ext controls may not render anything to the page.

    With the Button, we set the Click event property of ClientEvents to the AutoPostBack function. When AutoPostBack was set to false, we were mistakingly still setting the Click event, although not passing in a function to fire. This caused a js error to be thrown.

    With version 0.4.*, you can work around this problem be setting the Click event to "Ext.emptyFn" or any custom function.

    Example

    <cool:Button runat="server" Text="Submit" ID="Button1" AutoPostBack="False">
        <ClientEvents>
            <Click Handler="Ext.emptyFn" />
        </ClientEvents>
    </cool:Button>
    We caught the problem just after the 0.4.1 release and I've confirmed that it's working fine for the 0.5 build.

    For reference, with the 0.5 release we've changed a few things and the following code sample demonstrates how the above example would be coded in 0.5.

    Example

    <ext:Button runat="server" Text="Submit" ID="Button1">
        <Listeners>
            <Click Handler="Ext.emptyFn" />
        </Listeners>
    </ext:Button>
    With 0.5 you also do not need to set the AutoPostBack property to false, if you set a custom Click event.

    Example

    <ext:Button runat="server" Text="Submit" ID="Button1">
        <Listeners>
            <Click Handler="function(){ Ext.Msg.alert('Hello', 'You Clicked Me'); }" />
        </Listeners>
    </ext:Button>
    Hope this helps.

    Geoffrey McGill
    Founder
  3. #3

    RE: [FIXED] Button does not show if AutoPost set to false...



    Hi geoffry.mcgill,

    Thanks for the explanation for the bug report. But looking at the following code block in your reply, I have a concern that your future release might not be backwards compatible!

    <cool:Button runat="server" Text="Submit" ID="Button1" AutoPostBack="False">    
        <ClientEvents>
            <Click Handler="Ext.emptyFn" />
        </ClientEvents>
    </cool:Button>
    <ext:Button runat="server" Text="Submit" ID="Button1">
        <Listeners>
            <Click Handler="Ext.emptyFn" />
        </Listeners>
    </ext:Button>
    Especially, cool and the ext part. Not that I have hundreds of pages to fix, but how can I be sure that such breaking changes won't happen frequently in future releases!


    Thanks,
    kraghavk
  4. #4

    RE: [FIXED] Button does not show if AutoPost set to false...

    Hi kraghavk,

    Yes, there will be a few breaking changes with the 0.5 release. Obviously we would rather not introduce any breaking changes, but you can expect some 'corrections' in each release until we hit version 1.0. There will be no backwards compatibility logic added to the toolkit until we have reached at least final version 1.0 release. And in general, the "breaking changes" will involve just renaming properties.

    With version 0.5 we're renaming the following:

    1. <LI>TagPrefix is now <ext: from <cool:</LI>
      <LI>Assembly/Namespace is now Coolite.Ext.Web, from Coolite.Web.UI</LI>
      <LI><ClientEvents> is now <Listeners></LI>
      <LI>The <Items> node/collection in TabPanel is now <Tabs>
      </LI>
    Adjusting for all four breaking changes will require a simple search-and-replace. The logic or functionality of each has not changed.

    Geoffrey McGill
    Founder

Similar Threads

  1. Set button visible to false
    By glenh in forum 1.x Help
    Replies: 2
    Last Post: Aug 24, 2009, 10:44 AM
  2. Replies: 7
    Last Post: Nov 13, 2008, 10:19 PM
  3. Replies: 2
    Last Post: Nov 11, 2008, 1:47 PM
  4. Replies: 2
    Last Post: Oct 25, 2008, 5:10 AM
  5. Replies: 4
    Last Post: Sep 10, 2008, 4:17 AM

Posting Permissions