Exception using DirectEvents and label text edition (Ext.Net 3.2)

  1. #1

    Exception using DirectEvents and label text edition (Ext.Net 3.2)

    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_ReferenceResolver(IReferenceResolver value) +105
       Newtonsoft.Json.JsonSerializer.ApplySerializerSettings(JsonSerializer serializer, JsonSerializerSettings settings) +1486
       Newtonsoft.Json.JsonSerializer.CreateDefault(JsonSerializerSettings 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
  2. #2
    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)
  3. #3
    To cross reference - the related thread:
    http://forums.ext.net/showthread.php?59793

Similar Threads

  1. About label text's length
    By kulolo in forum 2.x Help
    Replies: 1
    Last Post: Oct 21, 2013, 3:54 PM
  2. Set Text Label
    By Aod47 in forum 1.x Help
    Replies: 1
    Last Post: Aug 15, 2013, 2:54 PM
  3. Replies: 1
    Last Post: Sep 24, 2011, 10:52 PM
  4. Community Edition and Professional Edition
    By lihl in forum Licensing
    Replies: 3
    Last Post: Sep 28, 2010, 2:45 AM
  5. [CLOSED] DirectEvents - Confirmation with custom text on buttons
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 19, 2010, 2:02 PM

Tags for this Thread

Posting Permissions