PDA

View Full Version : [CLOSED] Using InsertItem to populate SelectBox does not return correct SelectedItem value



CarpFisher
Jun 18, 2012, 6:49 PM
Using InsertItem to populate SelectBox does not return correct SelectedItem value, instead it is returning the text part. Please use the following code to test, thank you so much:




<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">

[DirectMethod]
public void load()
{
sbxTest.InsertItem(0, "a", "1");
sbxTest.InsertItem(0, "b", "2");
sbxTest.InsertItem(0, "c", "3");

}

[DirectMethod]
public void getSelected()
{
X.MessageBox.Alert("test", "value:" + sbxTest.SelectedItem.Value).Show();

}

</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></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:SelectBox ID="sbxTest" runat="server" FieldLabel="Test" LabelWidth="150" Padding="5"> </ext:SelectBox>
<ext:button runat="server" text="load values">
<Listeners>
<Click Handler="#{DirectMethods}.load()"></Click>
</Listeners>
</ext:button>

<ext:button runat="server" text="Get selected">
<Listeners>
<Click Handler="#{DirectMethods}.getSelected()"></Click>
</Listeners>
</ext:button>
</form>
</body>
</html>

CarpFisher
Jun 18, 2012, 7:06 PM
I compiled the latest code from the SVN and it behaves correctly now. I think it is fixed somehow along the other bugs

Daniil
Jun 18, 2012, 8:39 PM
Hi,

It has been fixed just today. Anyways, thanks for the report.