PDA

View Full Version : [CLOSED] ExtraParams in DirectEvents comes back 'null'



Fahd
Jun 22, 2012, 7:18 PM
On my ChangeHandle event the code below returns 'null'

var item = e.ExtraParams["item"];



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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
var store = this.SelectBox1.GetStore();

store.DataSource = new object[]
{
new object[] { "AL", "Alabama", "The Heart of Dixie" },
new object[] { "AK", "Alaska", "The Land of the Midnight Sun" },
new object[] { "AZ", "Arizona", "The Grand Canyon State" },
new object[] { "AR", "Arkansas", "The Natural State" },
new object[] { "CA", "California", "The Golden State" },
new object[] { "WY", "Wyoming", "Like No Place on Earth"}
};

store.DataBind();
}

protected void ChangeHandle(object sender, DirectEventArgs e)
{
var item = e.ExtraParams["item"];
}

</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>SelectBox - Ext.NET Examples</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h3>
SelectBox</h3>
<ext:SelectBox ID="SelectBox1" runat="server" DisplayField="state" ValueField="abbr"
EmptyText="Select a state...">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="abbr" />
<ext:ModelField Name="state" />
<ext:ModelField Name="nick" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<DirectEvents>
<Select OnEvent="ChangeHandle" Type="Load" Method="POST">
<ExtraParams>
<ext:Parameter Name="item" Value="SelectBox1.value" Mode="Raw" />
</ExtraParams>
</Select>
</DirectEvents>
</ext:SelectBox>
</form>
</body>
</html>

Vladimir
Jun 22, 2012, 7:23 PM
Please use the following code


Value="#{SelectBox1}.getValue()"

Fahd
Jun 22, 2012, 7:44 PM
that works, thanks.


Please use the following code


Value="#{SelectBox1}.getValue()"