View Full Version : [FIXED] [V0.6] ComboBox and Selected Item

Sep 16, 2008, 12:53 PM
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">

<ext:Panel StyleSpec="padding:10px;" ID="loinopanel" Height="50px" runat="server" BodyBorder ="false"><Content >
<table >
<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" />
<SelectedItem Text ="SRA" Value ="SRA" />
<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." />
<SelectedItem Text="Pvt." Value ="Pvt." />

<ext:Label StyleSpec="padding-left:15px;" AutoShow ="true" ID="lbladdloi" runat="server" Text=""></ext:Label>

<Buttons >
<ext:Button runat="server" ID="btnaddloi" Text ="Add" Icon="Add">
<Listeners >
<Click Handler="#{txtloino}.validate();#{precombo}.validate();#{po stcombo}.validate();if(!#{txtloino}.isValid()||!#{ precombo}.isValid()||!#{postcombo}.isValid()){retu rn false;};" />
<Click OnEvent="btnaddloi_Click">

<EventMask Msg ="Adding..." MinDelay ="0"/>


<ext:Button runat="server" ID="cancelloi" Text ="Close" Autopostback="false" Icon="Cancel" OnClientClick ="#{addloi}.hide();" ></ext:Button>


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.
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.


Sep 16, 2008, 5:44 PM
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"

<script runat="server">
protected void btnSubmit_Click(object sender, AjaxEventArgs e)
lblWait.Text = "You selected: " + ComboBox1.SelectedItem.Value;

<html xmlns="http://www.w3.org/1999/xhtml" >
<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" />
<ext:ListItem Text="One" Value="1" />
<ext:ListItem Text="Two" Value="2" />
<ext:Button ID="btnSubmit" runat="server" Text="Submit">
<Click OnEvent="btnSubmit_Click" />
<ext:Label ID="lblWait" runat="server" Text="Waiting ..." />


Sep 16, 2008, 6:03 PM
Thanks Buddy...

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