[CLOSED] Why some characters can not be submitted

  1. #1

    [CLOSED] Why some characters can not be submitted

    When I select the first line, and then click the button, everything is normal
    But when I choose second or third lines, and then click the button, there is a 200 error:
    Status Code: 200
    Status Text: NORESPONSE

    Click image for larger version. 

Name:	pic20160815221015.png 
Views:	72 
Size:	34.3 KB 
ID:	24718

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = new List<Company>
                {
                    new Company(0, "3m Co", 71.72, 0.02, 0.03),
                    new Company(1, "BOK11RB06(53cm×10m/53CM)14XY/ Recolor Beach/P41", 29.01, 0.42, 1.47),
                    new Company(2, "BB.0359 ANDANTE", 83.81, 0.28, 0.34)
                };
    
                if (!this.IsPostBack)
                {
                    RowSelectionModel sm = this.GridPanel1.GetSelectionModel() as RowSelectionModel;
    
                    sm.SelectedRows.Add(new SelectedRow(1));
                }
            }
        }
    
        protected void Button1_Click(object sender, DirectEventArgs e)
        {
            string json = e.ExtraParams["Values"]; 
            this.Label1.Html = json.ToString();
        }
    
        public class Company
        {
            public Company(int id, string name, double price, double change, double pctChange)
            {
                this.ID = id;
                this.Name = name;
                this.Price = price;
                this.Change = change;
                this.PctChange = pctChange;
            }
    
            public int ID { get; set; }
            public string Name { get; set; }
            public double Price { get; set; }
            public double Change { get; set; }
            public double PctChange { get; set; }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>GridPanel with Checkbox Selection Model - Ext.NET Examples</title>
    
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
        <script>
            /* A header Checkbox of CheckboxSelectionModel deals with the current page only.
               This override demonstrates how to take into account all the pages.
               It works with local paging only. It is not going to work with remote paging.
            */
            Ext.selection.CheckboxModel.override({
                selectAll: function (suppressEvent) {
                    var me = this,
                        selections = me.store.getAllRange(), // instead of the getRange call
                        i = 0,
                        len = selections.length,
                        start = me.getSelection().length;
    
                    me.suspendChanges();
    
                    for (; i < len; i++) {
                        me.doSelect(selections[i], true, suppressEvent);
                    }
    
                    me.resumeChanges();
                    if (!suppressEvent) {
                        me.maybeFireSelectionChange(me.getSelection().length !== start);
                    }
                },
    
                deselectAll: Ext.Function.createSequence(Ext.selection.CheckboxModel.prototype.deselectAll, function () {
                    this.view.panel.getSelectionMemory().clearMemory();
                }),
    
                updateHeaderState: function () {
                    var me = this,
                        store = me.store,
                        storeCount = store.getTotalCount(),
                        views = me.views,
                        hdSelectStatus = false,
                        selectedCount = 0,
                        selected, len, i;
    
                    if (!store.buffered && storeCount > 0) {
                        selected = me.view.panel.getSelectionMemory().selectedIds;
                        hdSelectStatus = true;
                        for (s in selected) {
                            ++selectedCount;
                        }
    
                        hdSelectStatus = storeCount === selectedCount;
                    }
    
                    if (views && views.length) {
                        me.toggleUiHeader(hdSelectStatus);
                    }
                }
            });
    
            Ext.grid.plugin.SelectionMemory.override({
                memoryRestoreState: function (records) {
                    if (this.store !== null && !this.store.buffered && !this.grid.view.bufferedRenderer) {
                        var i = 0,
                            ind,
                            sel = [],
                            len,
                            all = true,
                            cm = this.headerCt;
    
                        if (!records) {
                            records = this.store.getAllRange(); // instead of getRange
                        }
    
                        if (!Ext.isArray(records)) {
                            records = [records];
                        }
    
                        if (this.selModel.isLocked()) {
                            this.wasLocked = true;
                            this.selModel.setLocked(false);
                        }
    
                        if (this.selModel instanceof Ext.selection.RowModel) {
                            for (ind = 0, len = records.length; ind < len; ind++) {
                                var rec = records[ind],
                                    id = rec.getId();
    
                                if ((id || id === 0) && !Ext.isEmpty(this.selectedIds[id])) {
                                    sel.push(rec);
                                } else {
                                    all = false;
                                }
    
                                ++i;
                            }
    
                            if (sel.length > 0) {
                                this.surpressDeselection = true;
                                this.selModel.select(sel, false, !this.grid.selectionMemoryEvents);
                                this.surpressDeselection = false;
                            }
                        } else {
                            for (ind = 0, len = records.length; ind < len; ind++) {
                                var rec = records[ind],
                                    id = rec.getId();
    
                                if ((id || id === 0) && !Ext.isEmpty(this.selectedIds[id])) {
                                    if (this.selectedIds[id].dataIndex) {
                                        var colIndex = cm.getHeaderIndex(cm.down('gridcolumn[dataIndex=' + this.selectedIds[id].dataIndex + ']'))
                                        this.selModel.setCurrentPosition({
                                            row: i,
                                            column: colIndex
                                        });
                                    }
                                    return false;
                                }
    
                                ++i;
                            }
                        }
    
                        if (this.selModel instanceof Ext.selection.CheckboxModel) {
                            if (all && (records.length > 0)) {
                                this.selModel.toggleUiHeader(true);
                            } else {
                                this.selModel.toggleUiHeader(false);
                            }
                        }
    
                        if (this.wasLocked) {
                            this.selModel.setLocked(true);
                        }
                    }
                }
            });
        </script>
    
        <script>
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <h1>GridPanel with Checkbox Selection Model</h1>
    
            <ext:GridPanel
                ID="GridPanel1"
                runat="server"
                Title="Company List"
                Collapsible="true"
                Width="600">
                <Store>
                    <ext:Store ID="Store1" runat="server" PageSize="10">
                        <Model>
                            <ext:Model runat="server" IDProperty="ID">
                                <Fields>
                                    <ext:ModelField Name="ID" />
                                    <ext:ModelField Name="Name" />
                                    <ext:ModelField Name="Price" />
                                    <ext:ModelField Name="Change" />
                                    <ext:ModelField Name="PctChange" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column
                            runat="server"
                            Text="Company"
                            Width="160"
                            DataIndex="Name"
                            Resizable="false"
                            MenuDisabled="true"
                            Flex="1" />
    
                        <ext:Column runat="server" Text="Price" Width="75" DataIndex="Price">
                            <Renderer Format="UsMoney" />
                        </ext:Column>
    
                        <ext:Column runat="server" Text="Change" Width="75" DataIndex="Change">
                            <Renderer Fn="change" />
                        </ext:Column>
    
                        <ext:Column runat="server" Text="Change" Width="75" DataIndex="PctChange">
                            <Renderer Fn="pctChange" />
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <BottomBar>
                    <ext:PagingToolbar runat="server" DisplayInfo="false" HideRefresh="true">
                        <Items>
                            <ext:Button ID="Button1" runat="server" Text="Submit Selected Records" StandOut="true">
                                <DirectEvents>
                                    <Click OnEvent="Button1_Click">
                                        <EventMask ShowMask="true" />
                                        <ExtraParams>
                                            <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly : true}))" Mode="Raw" />
                                        </ExtraParams>
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:PagingToolbar>
                </BottomBar>
                <SelectionModel>
                    <ext:CheckboxSelectionModel runat="server" Mode="Multi" />
                </SelectionModel>
            </ext:GridPanel>
    
            <div style="width: 590px; border: 1px solid gray; padding: 5px;">
                <ext:Label ID="Label1" runat="server" />
            </div>
        </form>
    </body>
    </html>
    Last edited by fabricio.murta; Aug 16, 2016 at 8:26 PM.
  2. #2
    Hello @CPA1158139!

    I have a good and bad news for you.

    Good news is that your example works just fine. The example you provided works at once, despite it being very long.

    Bad news is exactly the good news, your example works too well on my side, I can submit any of the three records, they work just fine -- at least from my Visual Studio environment.

    Click image for larger version. 

Name:	61364-submitSuccess.png 
Views:	74 
Size:	26.8 KB 
ID:	24719

    It most likely means you are having charset encoding issues probably due to the chinese language set up either on your project or computer (windows Regional Settings). I believe that somewhere in your end there's no UTF8 conversion/encoding, thus the server receives binary data it discards and results in the error.

    With this information, maybe you can solve the problem already. Otherwise, maybe it helps you identify some important setting in project or machine in order to reproduce this in our end?

    One valid attempt you can make is, download the v3 examples explorer project and try and run this example on that project on your machine. If there's just a project setting on your end, you should be able to run this example on your Visual Studio. It would likely fail if that's a system-wide localization setting (windows' regional settings for example) or some other system-wide charset setting.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    hi fabricio,

    Thanks for your quick response.
    You are right, I downloaded the v3 examples explorer project and try and run this example . It works fine.
    So I rebuilt the project. Currently working well.

    Pls close,thank you very much.
    Last edited by CPA1158139; Aug 16, 2016 at 2:58 PM.
  4. #4
    Glad it helped you sort out the issue!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Disabled components are submitted
    By Daly_AF in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 13, 2012, 3:58 PM
  2. [CLOSED] Disabled fields don't get submitted
    By zwf in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 01, 2012, 11:47 AM
  3. [CLOSED] [1.0] Hidden Fields Not Being Submitted
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 25, 2011, 8:23 PM
  4. [CLOSED] Combo Box disable Value not getting submitted.
    By Hari_CSC in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 07, 2010, 11:06 AM
  5. Submitted data too big
    By marcossoft in forum 1.x Help
    Replies: 9
    Last Post: Jul 27, 2009, 7:26 PM

Posting Permissions