PDA

View Full Version : [CLOSED] MultiSelect initialized failed



cleve
Jun 07, 2012, 7:47 AM
Here's my code:



<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<List<string>>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="/themes/shared.css" type="text/css" rel="stylesheet" />
<link href="/themes/icons.css" type="text/css" rel="stylesheet" />
</head>
<body id="theBody">
<ext:ResourceManager ID="theManager" runat="server"
IDMode="Inherit"
Theme="Default"
EnableViewState="false"
DisableViewState="true"
ShowWarningOnAjaxFailure="false" ScriptMode="Debug" />
<ext:Panel runat="server" Height="400" Width="400" Layout="HBoxLayout">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="AAA">
<Listeners>
<Click Handler="testFunc();" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:MultiSelect runat="server" Flex="1" DisplayField="field1" ValueField="field2">
<Store>
<ext:Store runat="server" ID="s" AutoLoad="false">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="field1" />
<ext:ModelField Name="field2" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:MultiSelect>
</Items>
</ext:Panel>
<script language="javascript" type="text/javascript">
var testFunc = function () {
var store = <%= s.ClientID %>;
store.load();
}
</script>
<form runat="server" id="theForm" />
</body>
</html>
<script runat="server">
protected override void OnInit(EventArgs e)
{
List<object> data = new List<object>()
{
new {
field1 = "A", field2 = "1"
},
new {
field1 = "B", field2 = "2"
}
};
s.DataSource = data;
s.DataBind();

}
</script>



I want it go like this: MultiSelect is initially empty; when click "AAA", ajax call to behind and return with data array. MutiSelect's hence populated.
However the interface can not show reporting some failure on MultiSelect getting records value (error screenshot attached).

Daniil
Jun 07, 2012, 9:53 AM
Hi,

Thanks for the report. We will investigate a possible fix.

For now please set up

<CustomConfig>
<ext:ConfigItem Name="useHiddenField" Value="false" Mode="Raw" />
</CustomConfig>
for the MultiSelect.

Daniil
Jun 07, 2012, 3:19 PM
The fix has been committed to SVN, revision #4076.

Thanks again for the report.