PDA

View Full Version : Exception using DirectEvents and label text edition (Ext.Net 3.2)



Xenogears
Jul 16, 2015, 11:02 AM
Hi everyone, first i want to thank you of making this project and this community. I wish you could help me with this problem. The code is very simple and i don't know where is the bug, also i did this in older Ext.Net versions and i never got stuck doing this.



<ext:ComboBox runat="server"
ID="CB_Customer"
FieldLabel="Customer"
DisplayField="Name"
ValueField="CustomerID"
StoreID="ST_Customers"
QueryMode="Local"
ForceSelection="true"
TypeAhead="true"
Width="450">
<DirectEvents>
<Select OnEvent="OnCustomerSelectionChanged">
<EventMask Msg="Loading..." ShowMask="true"></EventMask>
</Select>
</DirectEvents>
</ext:ComboBox>
<ext:Label runat="server" ID="LB_CustomerTest" Html="TEST"></ext:Label>




protected void OnCustomerSelectionChanged(object sender, DirectEventArgs e)
{
LB_CustomerTest.Html = "ABC...";
}


Simply i wanted to modify label text when customers ComboBox selection has been changed. But this gives me an exception related to JSON serialization




[ArgumentNullException: Reference resolver cannot be null.
Nombre del parĂ¡metro: value]
Newtonsoft.Json.JsonSerializer.set_ReferenceResolv er(IReferenceResolver value) +105
Newtonsoft.Json.JsonSerializer.ApplySerializerSett ings(JsonSerializer serializer, JsonSerializerSettings settings) +1486
Newtonsoft.Json.JsonSerializer.CreateDefault(JsonS erializerSettings settings) +65
Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Type type, JsonSerializerSettings settings) +47
Newtonsoft.Json.JsonConvert.SerializeObject(Object value, JsonSerializerSettings settings) +44
Ext.Net.JSON.Serialize(Object obj, JsonSerializerSettings settings) +235
Ext.Net.JSON.Serialize(Object obj, IList`1 converters, IContractResolver resolver) +137
Ext.Net.JSON.Serialize(Object obj, IList`1 converters) +43
Ext.Net.TokenUtils.NormalizeRawToken(String script) +98
Ext.Net.TokenUtils.ParseAndNormalize(String script, Control seed) +56
Ext.Net.BaseControl.CallTemplate(ScriptPosition position, String template, String name, Object[] args) +283
Ext.Net.BaseControl.Call(ScriptPosition mode, String name, Object[] args) +54
Ext.Net.BaseControl.Call(String name, Object[] args) +50
Ext.Net.LabelBase.SetText(String text, Boolean encode) +155
Ext.Net.LabelBase.SetHtml(String html) +44


Currently Ext.Net is at version 3.2 (i tried 3.1, but give me the same problem) and Json.Net is at latest version too (7.0.1).

Could you help me?
Thanks in advance

jwf
Jul 16, 2015, 10:16 PM
I have a related and similar issue. Trying to call methods on controls from directevent code-behind throws the same ArgumentNullException from Newtonsoft.Json: Reference resolver cannot be null.

Examples: calling .SuspendEvents(false) on a button control, calling .SetValue("") on text field control.

This is on Windows 7, VS2013, ASP.NET Forms application running .NET 4.5, using the latest nuget package (ext.net 3.2, ext.net.utilities 2.5.0, newtonsoft.json 7.0.1, transformer.net 2.1.1)

Daniil
Jul 21, 2015, 3:55 PM
To cross reference - the related thread:
http://forums.ext.net/showthread.php?59793