[CLOSED] Error: Can't find the property 'BaseParams' in class 'PagingToolbar'

  1. #1

    [CLOSED] Error: Can't find the property 'BaseParams' in class 'PagingToolbar'

    Error: Can't find the property 'BaseParams' in class 'PagingToolbar'

    [InvalidOperationException: Can't find the property 'BaseParams' in class 'PagingToolbar']
    Ext.Net.ViewStateProcessor.LoadViewState(Object obj, Object state) +442
    Ext.Net.XControl.LoadViewState(Object state) +298
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +183
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Control.LoadChildViewStateByIndex(Ar rayList childState) +134
    System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState) +221
    System.Web.UI.Page.LoadAllState() +312
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1661
    <ext:GridPanel ID="GridPanelMain" runat="server" SelectionMemory="Enabled" TrackMouseOver="true">
        <Store>
        <ext:Store ID="StoreMain" runat="server" RemoteSort="true" OnRefreshData="Store1_RefreshData">
            <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="100" Mode="Raw" />
            <ext:Parameter Name="sort" Value="" />
            <ext:Parameter Name="dir" Value="" />
            </BaseParams>
            <Proxy>
            <ext:PageProxy />
            </Proxy>
        </ext:Store>
        </Store>
        <BottomBar>
        <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="100" DisplayInfo="true" DisplayMsg="Wiersze {0} - {1} z {2}" EmptyMsg="Brak wierszy">
            <Plugins>
            <ext:SlidingPager />
            </Plugins>
        </ext:PagingToolbar>
        </BottomBar>
        <LoadMask ShowMask="true" Msg="Proszę poczekać ..." />
    </ext:GridPanel>
    
    protected override void OnInit(EventArgs e)
    {
        if (!X.IsAjaxRequest)
        {
        if (this.StoreMain.Reader.Count == 0)
        {
            JsonReader StoreFields = new JsonReader();
            StoreFields.Fields.Add(
            new RecordField()
            {
                Name = "Id",
                Type = RecordFieldType.Int
            });
            StoreFields.Fields.Add(
            new RecordField()
            {
                Name = "Name",
                Type = RecordFieldType.String
            });
            StoreFields.IDProperty = "Id";
            this.StoreMain.Reader.Add(StoreFields);
        }
        if (this.GridPanelMain.ColumnModel.Columns.Count == 0)
        {
            ColumnCollection ColumnsList = new ColumnCollection();
            ColumnsList.Add(
            new NumberColumn()
            {
                DataIndex = "Id",
                Header = "ID",
                MenuDisabled = true
            });
            ColumnsList.Add(
            new Column()
            {
                DataIndex = "Name",
                Header = "Name",
                MenuDisabled = true
            });
            this.GridPanelMain.ColumnModel.Columns.AddRange(ColumnsList);
        }
        this.StoreMain.BaseParams["limit"] = "={" + GlobalSettings.pageSize.ToString() + "}";
        this.PagingToolbar1.PageSize = GlobalSettings.pageSize;
        }
    }
    
    protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)
    {
        List<object> data = MMEwidencja.BLL.DeviceInfo.GetFullList().Cast<object>().ToList<object>();
    
        //-- start sorting ------------------------------------------------------------
        if (!string.IsNullOrEmpty(e.Sort))
        {
        data.Sort(delegate(object x, object y)
        {
            object a;
            object b;
    
            int direction = e.Dir == Ext.Net.SortDirection.DESC ? -1 : 1;
    
            a = x.GetType().GetProperty(e.Sort).GetValue(x, null);
            b = y.GetType().GetProperty(e.Sort).GetValue(y, null);
            return CaseInsensitiveComparer.Default.Compare(a, b) * direction;
        });
        }
        //-- end sorting ------------------------------------------------------------
    
    
        //-- start paging ------------------------------------------------------------
        var limit = e.Limit;
    
        if ((e.Start + e.Limit) > data.Count)
        {
        limit = data.Count - e.Start;
        }
    
        List<object> rangeData = (e.Start < 0 || limit < 0) ? data : data.GetRange(e.Start, limit);
        //-- end paging ------------------------------------------------------------
    
        //The Total can be set in RefreshData event as below
        //or (Store1.Proxy.Proxy as PageProxy).Total in anywhere
        //Please pay attention that the Total make a sence only during DirectEvent because
        //the Store with PageProxy get/refresh data using ajax request
    
        e.Total = data.Count;
    
        this.GridPanelMain.GetStore().DataSource = rangeData;
    }
    Last edited by Daniil; Jul 04, 2011 at 12:00 PM. Reason: [CLOSED]
  2. #2
    Hi,

    ViewState errors can occur if Control tree is different between requests
    Please provide test sample which we can test localy
  3. #3
    Quote Originally Posted by Vladimir View Post
    Hi,

    ViewState errors can occur if Control tree is different between requests
    Please provide test sample which we can test localy
    The test localy works
    <!--<Proxy>
            <ext:PageProxy />
    </Proxy>-->
    
    protected override void OnInit(EventArgs e)
    {
    	if (!X.IsAjaxRequest)
    	{
                    ...............
                    ...............
                    if (this.StoreMain.Proxy.Count == 0)
                    {
                        this.StoreMain.DataSource = MMEwidencja.BLL.Device.GetList().Cast<object>().ToList<object>();
                        this.StoreMain.DataBind();
                    }
          }
    }
  4. #4
    Hi,

    If you remove PageProxy then data request will not be initiated.
    Try to initiate any direct event and i guess you will get the same ViewState error

    Just investigate what difference in the code behind logic during ajax requests, i think i don't recreate controls (or recreate it in the different sequence)
  5. #5
    I have found a problem. Excuse for troubling.

    protected override void OnInit(EventArgs e)
    {
    	if (this.StoreMain.Reader.Count == 0)
    	{
    	    JsonReader StoreFields = new JsonReader();
    	    StoreFields.Fields.Add(
    		new RecordField()
    		{
    		    Name = "Id",
    		    Type = RecordFieldType.Int
    		});
    	    StoreFields.Fields.Add(
    		new RecordField()
    		{
    		    Name = "Name",
    		    Type = RecordFieldType.String
    		});
    	    StoreFields.IDProperty = "Id";
    	    this.StoreMain.Reader.Add(StoreFields);
    	}
    	if (!X.IsAjaxRequest)
    	{
    		if (this.GridPanelMain.ColumnModel.Columns.Count == 0)
    		{
    		    ColumnCollection ColumnsList = new ColumnCollection();
    		    ColumnsList.Add(
    			new NumberColumn()
    			{
    			    DataIndex = "Id",
    			    Header = "ID",
    			    MenuDisabled = true
    			});
    		    ColumnsList.Add(
    			new NumberColumn()
    			{
    			    DataIndex = "Name",
    			    Header = "Name",
    			    MenuDisabled = true
    			});
    		    this.GridPanelMain.ColumnModel.Columns.AddRange(ColumnsList);
    		}
    		this.StoreMain.BaseParams["limit"] = "={" + GlobalSettings.pageSize.ToString() + "}";
    		this.PagingToolbar1.PageSize = GlobalSettings.pageSize;
    	}
    }
  6. #6
    Hi,

    Please clarify why did you use it?
    if (!X.IsAjaxRequest)
    I can't see any needs to don't execute that code during Ext.Net AjaxRequest (DirectEvent/DirectMethod).
  7. #7
    Quote Originally Posted by Daniil View Post
    Hi,

    Please clarify why did you use it?
    if (!X.IsAjaxRequest)
    I can't see any needs to don't execute that code during Ext.Net AjaxRequest (DirectEvent/DirectMethod).
    I don't know. Because so it works.
    During AjaxRequest the GridPanel has columns and it is not necessary to generate them.
  8. #8
    OnRefreshData handler is DirectEvent.

    It uses .BaseParams. So, please move
    this.StoreMain.BaseParams["limit"] = "={" + GlobalSettings.pageSize.ToString() + "}";
    out of
    if (!X.IsAjaxRequest)
  9. #9
    ok, thank you

Similar Threads

  1. Replies: 1
    Last Post: Apr 30, 2012, 7:34 AM
  2. Replies: 5
    Last Post: Apr 19, 2012, 4:35 PM
  3. Replies: 1
    Last Post: Nov 17, 2010, 11:36 AM
  4. Replies: 9
    Last Post: Aug 14, 2010, 4:22 AM
  5. [CLOSED] [1.0] error: Can't find the property 'Items' in class 'Label'
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 05, 2010, 7:07 AM

Tags for this Thread

Posting Permissions