[FIXED] [V0.7.0] ComboBox Bug

Page 2 of 2 FirstFirst 12
  1. #11

    RE: [FIXED] [V0.7.0] ComboBox Bug

    Here is another example.

    Example.aspx:
    <%@ Page Language="C#" %>
    
    <%@ 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">
    
    <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text = String.Format("{0} is index: {1}", ComboBox2.SelectedItem.Text, ComboBox2.SelectedIndex);
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
        <ext:ScriptManager ID="ScriptManager2" runat="server" ScriptMode="Debug" />
        <ext:ComboBox ID="ComboBox1"
            runat="server"
            EmptyText="----"
            FireSelect&#111;nload="True"
            Width="255">
            <Items>
                <ext:ListItem Text="Create new Country..." Value="" />
                <ext:ListItem Text="Canada" Value="CA" />
                <ext:ListItem Text="United States" Value="USA" />
            </Items>
            <Listeners>
                <Select Handler="#{ComboBox2}.clearValue();" />
            </Listeners>
        </ext:ComboBox>
        <ext:ComboBox ID="ComboBox2"
            runat="server"
            EmptyText="----"
            FireSelect&#111;nload="True"
            Width="255">
            <Items>
                <ext:ListItem Text="Create new Province ..." Value="" />
                <ext:ListItem Text="Ontario" Value="ON" />
                <ext:ListItem Text="Quebec" Value="QC" />
            </Items>
            <Listeners>
                <Select Handler="#{ComboBox3}.clearValue();" />
            </Listeners>
        </ext:ComboBox>
        <ext:ComboBox ID="ComboBox3"
            runat="server"
            EmptyText="-----"
            FireSelect&#111;nload="True"
            Width="255">
            <Items>
                <ext:ListItem Text="Create new City ..." Value="" />
                <ext:ListItem Text="Ottawa" Value="OT" />
                <ext:ListItem Text="Toronto" Value="TO" />
            </Items>
        </ext:ComboBox>
        <ext:Button ID="Button1" runat="server" AutoPostBack="True" &#111;nclick="Button1_Click" Text="Submit">
            <Listeners>
                <Click Handler="
                        alert('ComboBox1.selectedIndex=' + #{ComboBox1}.selectedIndex + ' ' + 'ComboBox2.selectedIndex=' + #{ComboBox2}.selectedIndex + ' ' + 'ComboBox3.selectedIndex=' + #{ComboBox3}.selectedIndex);
                        if (#{ComboBox3}.selectedIndex &amp;gt; 0) #{ComboBox3}.clearValue();
                        else if (#{ComboBox2}.selectedIndex &amp;gt; 0) #{ComboBox2}.clearValue();
                        else #{ComboBox1}.clearValue();
                    "/>
            </Listeners>
        </ext:Button>
        <ext:Label ID="Label1" runat="server" Text="Waiting ..." />
        </form>
    </body>
    </html>
    Replication steps:

    1. Load page
    2. Select 'Canada', 'Ontario', 'Ottawa'
    3. Hit 'Submit' (works)
    4. Hit 'Submit' again (fails) ?

    Cheers,
    Timothy
  2. #12

    RE: [FIXED] [V0.7.0] ComboBox Bug

    Geoffrey,

    When are you expecting changes to the control? I've got broken things on our solution because we are using this control to use the HttpProxy in the store for a dropdown.

    Please advise.

    Timothy
  3. #13

    RE: [FIXED] [V0.7.0] ComboBox Bug



    Hi Timothy,

    We added a new client-side property/function to the <ext:ComboBox> called .getSelectedIndex().

    The following code sample demonstrates your last example but using .getSelectedIndex().

    Example

    <%@ Page Language="C#" %>
    
    
    <%@ 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">
    
    
    <script runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text = String.Format("{0} is index: {1}", ComboBox2.SelectedItem.Text, ComboBox2.SelectedIndex);
        }
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Example</title>
    </head>
    <body>
        <p><a href="LinkedComboBoxes.aspx">Reload</a></p>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <ext:ScriptManager ID="ScriptManager2" runat="server" ScriptMode="Debug" />
            
            <ext:ComboBox ID="ComboBox1"
                runat="server"
                EmptyText="----"
                FireSelect&#111;nload="True"
                Width="255">
                <Items>
                    <ext:ListItem Text="Create new Country..." Value="" />
                    <ext:ListItem Text="Canada" Value="CA" />
                    <ext:ListItem Text="United States" Value="USA" />
                </Items>
                <Listeners>
                    <Select Handler="console.log('ComboBox1_Select');#{ComboBox2}.clearValue();" />
                    <Change Handler="console.log('ComboBox1_Change');" />
                </Listeners>
            </ext:ComboBox>
            
            <ext:ComboBox 
                ID="ComboBox2"
                runat="server"
                EmptyText="----"
                FireSelect&#111;nload="True"
                Width="255">
                <Items>
                    <ext:ListItem Text="Create new Province ..." Value="" />
                    <ext:ListItem Text="Ontario" Value="ON" />
                    <ext:ListItem Text="Quebec" Value="QC" />
                </Items>
                <Listeners>
                    <Select Handler="console.log('ComboBox2_Select');#{ComboBox3}.clearValue();" />
                </Listeners>
            </ext:ComboBox>
            
            <ext:ComboBox ID="ComboBox3"
                runat="server"
                EmptyText="-----"
                FireSelect&#111;nload="True"
                Width="255">
                <Items>
                    <ext:ListItem Text="Create new City ..." Value="" />
                    <ext:ListItem Text="Ottawa" Value="OT" />
                    <ext:ListItem Text="Toronto" Value="TO" />
                </Items>
                <Listeners>
                    <Select Handler="console.log('ComboBox3_Select');" />
                </Listeners>
            </ext:ComboBox>
            
            <ext:Button ID="Button1" runat="server" AutoPostBack="True" &#111;nclick="Button1_Click" Text="Submit">
                <Listeners>
                    <Click Handler="
                        alert('ComboBox1.getSelectedIndex() = ' 
                            + #{ComboBox1}.getSelectedIndex() + '\n' 
                            + 'ComboBox2.getSelectedIndex() = ' 
                            + #{ComboBox2}.getSelectedIndex() + '\n' 
                            + 'ComboBox3.getSelectedIndex() = ' 
                            + #{ComboBox3}.getSelectedIndex());
                            
                        if (#{ComboBox3}.getSelectedIndex() &amp;gt; 0) {
                            #{ComboBox3}.clearValue();
                        } else if (#{ComboBox2}.getSelectedIndex() &amp;gt; 0) { 
                            #{ComboBox2}.clearValue();
                        } else {
                            #{ComboBox1}.clearValue();
                        }"/>
                </Listeners>
            </ext:Button>
            
            <ext:Label ID="Label1" runat="server" Text="Waiting ..." />
        </form>
    </body>
    </html>
    Hope this helps.
    Geoffrey McGill
    Founder
  4. #14

    RE: [FIXED] [V0.7.0] ComboBox Bug



    FYI: The .setValueEx() function has been renamed to .setValueAndFireSelect().
    Geoffrey McGill
    Founder
  5. #15

    RE: [FIXED] [V0.7.0] ComboBox Bug

    Geoffrey,

    Great! I'm going to give this a go today and I'll get back to you :)

    Sincerely,
    Timothy Grant Vogelsang
  6. #16

    RE: [FIXED] [V0.7.0] ComboBox Bug

    Awesome works very well Geoffrey, thanks for the effort!

    Cheers,
    Timothy
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [FIXED] [V0.7] ComboBox SelectedIndex
    By Timothy in forum Bugs
    Replies: 9
    Last Post: Aug 20, 2009, 3:19 PM
  2. [FIXED] [V0.6] ComboBox HideTrigger
    By Timothy in forum Bugs
    Replies: 6
    Last Post: Jan 22, 2009, 11:57 AM
  3. [FIXED] [V0.7] ComboBox Bug
    By Timothy in forum Bugs
    Replies: 6
    Last Post: Nov 01, 2008, 12:32 PM
  4. [FIXED] [V0.7.0] ComboBox Bug
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Oct 10, 2008, 11:59 AM
  5. [FIXED] [V0.6] ComboBox
    By Timothy in forum Bugs
    Replies: 7
    Last Post: Aug 26, 2008, 2:47 PM

Posting Permissions