PDA

View Full Version : [CLOSED] ComboBox getValue returns text instead of value



marco.morreale
Jun 15, 2012, 10:42 AM

Daniil
Jun 15, 2012, 11:32 AM
Hi,

Reproduced. I would consider it a bug. Then we bind ListItems during DirectEvent, Text and Value are swapped.

We are investigating. Here is a simplified example to reproduce the problem.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void DataBind(object sender, DirectEventArgs e)
{
this.ComboBox1.Items.Add(new Ext.Net.ListItem()
{
Value = "New value",
Text = "New text"
});
this.ComboBox1.GetStore().DataBind();
}
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:ComboBox ID="ComboBox1" runat="server">
<Items>
<ext:ListItem Text="some text" Value="some value" />
</Items>
</ext:ComboBox>
<ext:Button runat="server" Text="DataBind" OnDirectClick="DataBind" />

<ext:Button runat="server" Text="getValue()">
<Listeners>
<Click Handler="alert(App.ComboBox1.getValue());" />
</Listeners>
</ext:Button>
</form>
</body>
</html>

Daniil
Jun 15, 2012, 1:23 PM
Please update from SVN and re-test.

marco.morreale
Jun 15, 2012, 3:20 PM
Should I update to 2.0 or 2.1?
M

marco.morreale
Jun 15, 2012, 3:29 PM
I updated to 2.1 Revision 4104 but still get the same error.
M

Daniil
Jun 15, 2012, 3:55 PM
Please update from the 2.0 branch.

marco.morreale
Jun 18, 2012, 7:51 AM
Hi Daniil,
now the value filed is displayed instead of text field.

4373

Daniil
Jun 18, 2012, 10:50 AM
Confirm, it's another issue. We will investigate, thanks for the report.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Load(object sender, DirectEventArgs e)
{
this.ComboBox1.Items.Add(new Ext.Net.ListItem("Some text", "Some value"));
this.ComboBox1.GetStore().DataBind();
}
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:ComboBox ID="ComboBox1" runat="server" QueryMode="Local" />
<ext:Button
runat="server"
Text="Load Items"
OnDirectClick="Load" />
</body>
</html>

Daniil
Jun 18, 2012, 4:26 PM
Fixed in SVN, please update.

Thanks again for the report.

marco.morreale
Jun 19, 2012, 7:22 AM
It's ok now. You can mark as "closed".
Thank you
M