[FIXED] [V0.6] ComboBox and Selected Item

  1. #1

    [FIXED] [V0.6] ComboBox and Selected Item

    Hi,
    I have the following code.

    <ext:Window Collapsible ="false"  Modal="true" DefaultButton="#{btnaddloi}" Width="367px" Height="150px" ID="addloi" Icon ="Add" ShowOnLoad ="false" AnimateTarget ="btn" AnimCollapse ="true"  runat="server" Title="Add LOI">
                <Content>
               
               <ext:Panel  StyleSpec="padding:10px;" ID="loinopanel" Height="50px" runat="server" BodyBorder ="false"><Content >
               <table >
               <tr><td>
               <ext:ComboBox AllowBlank="false" Editable="false" BlankText="Select" Width="70px" Mode ="Local" ID="precombo" runat="server">
               <Items >
               <ext:ListItem Text ="SRA" Value ="SRA" />
               <ext:ListItem Text ="ENG" Value ="ENG" />
               </Items>
               <SelectedItem Text ="SRA" Value ="SRA" />
               </ext:ComboBox></td>
               <td><ext:Label Text ="&amp;nbsp;/&amp;nbsp;" runat="server"></ext:Label></td>
             <td><ext:textfield AllowBlank="false" BlankText="Enter Loi No" EmptyText ="Please enter no"   ID="txtloino" runat="server" ></ext:textfield></td>
               <td><ext:Label  Text ="&amp;nbsp;/T/&amp;nbsp;" runat ="server"></ext:Label></td>
                <td><ext:ComboBox Editable="false" AllowBlank="false" BlankText="Select" Width="90px" ID="postcombo" runat ="server" >
               <Items >
               <ext:ListItem Text="Pvt." Value ="Pvt." />
               <ext:ListItem Text="M.C.G.M." Value ="M.C.G.M." />
               <ext:ListItem Text="MHADA" Value ="MHADA" />
               <ext:ListItem Text ="Govt." Value ="Govt." />
               </Items>
               <SelectedItem Text="Pvt." Value ="Pvt." />
               </ext:ComboBox></td></tr>
               </table>
               
              
    
               
              
               </Content></ext:Panel>
               <ext:Label StyleSpec="padding-left:15px;" AutoShow ="true"  ID="lbladdloi" runat="server" Text=""></ext:Label>
              
                </Content>
               <Buttons >
               <ext:Button runat="server" ID="btnaddloi" Text ="Add" Icon="Add">
               <Listeners >
               <Click Handler="#{txtloino}.validate();#{precombo}.validate();#{postcombo}.validate();if(!#{txtloino}.isValid()||!#{precombo}.isValid()||!#{postcombo}.isValid()){return false;};" />
               </Listeners>
               <AjaxEvents>
               <Click OnEvent="btnaddloi_Click">
               
               <EventMask Msg ="Adding..." MinDelay ="0"/>
               </Click>
               
               </AjaxEvents>
               
               </ext:Button>
                          <ext:Button runat="server" ID="cancelloi" Text ="Close" Autopostback="false"  Icon="Cancel" OnClientClick ="#{addloi}.hide();" ></ext:Button>
    
               </Buttons> 
            </ext:Window>
    Here, when I click the button, the value of selected item is not passed to the code behind. Its Blank. But the selected item is shown in the combobox.
    try
    me.lbladdloi.text = me.precombo.selecteditem.value

    But when I explicitely select an item. The value is passed properly.

    Looks like a bug to me.

    Thanks,


  2. #2

    RE: [FIXED] ComboBox and Selected Item

    This was fixed in SVN; the following simplified example works:

    <%@ 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 btnSubmit_Click(object sender, AjaxEventArgs e)
        {
            lblWait.Text = "You selected: " + ComboBox1.SelectedItem.Value;
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Word</title>
    </head>
    <body>
        <p><a href="Example.aspx">Reload</a></p>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
            <ext:ComboBox ID="ComboBox1" runat="server">
                <SelectedItem Text="One" Value="1" />
                <Items>
                    <ext:ListItem Text="One" Value="1" />
                    <ext:ListItem Text="Two" Value="2" />
                </Items>
            </ext:ComboBox>
            <ext:Button ID="btnSubmit" runat="server" Text="Submit">
                <AjaxEvents>
                    <Click OnEvent="btnSubmit_Click" />
                </AjaxEvents>
            </ext:Button>
            <ext:Label ID="lblWait" runat="server" Text="Waiting ..." />
        </form>
    </body>
    </html>
    Cheers,
    Timothy
  3. #3

    RE: [FIXED] ComboBox and Selected Item

    Thanks Buddy...

    dunno how long I will have to wait for the Preview then...

    Thanks,

Similar Threads

  1. [CLOSED] Always selected Item is nothing for combobox as menu item
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2011, 4:51 PM
  2. [CLOSED] get the value of the selected item from a combobox via js
    By Edward in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 03, 2010, 12:06 PM
  3. [CLOSED] ComboBox set selected item value
    By pumpkin in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 27, 2009, 7:26 AM
  4. Get Combobox Selected item
    By yarlenvas in forum 1.x Help
    Replies: 3
    Last Post: Mar 08, 2009, 2:04 PM
  5. Get ComboBox Selected Item
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 18, 2008, 9:50 AM

Posting Permissions