[CLOSED] Wrong response when trying to use an ObjectDataSource

  1. #1

    [CLOSED] Wrong response when trying to use an ObjectDataSource

    Hello,
    first of all I want to greet everybody as this is my first post. And I also want to congratulate you on this great library.

    So, what I am trying to do is the following:

    Simple ext:GridPanel getting data from an ObjectDataSource (I must say this is my first proper test).
    This is the ASP code:
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetGroups" TypeName="Group" OnSelected="ObjectDataSource1_Selected">
                <SelectParameters>
                    <asp:Parameter Name="start" Type="Int32" />
                    <asp:Parameter Name="limit" Type="Int32" />
                    <asp:Parameter Name="sort" />
                    <asp:Parameter Name="dir" />
                    <asp:Parameter Name="count" Direction="Output" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
    
            <ext:Store ID="Store1" runat="server" AutoLoad="true" RemoteSort="true" DataSourceID="ObjectDataSource1" OnRefreshData="Store1_RefreshData">
                <AutoLoadParams>
                    <ext:Parameter Name="start" Value="={0}" />
                    <ext:Parameter Name="limit" Value="={3}" />
                </AutoLoadParams>
                <Proxy>
                    <ext:DataSourceProxy />
                </Proxy>
    
                <Reader>
                    
                    <ext:JsonReader ReaderID="ID">
                        <Fields>
                            <ext:RecordField Name="Name" />
                            <ext:RecordField Name="Status" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
    
                                        <ext:GridPanel 
                                            ID="GridPanel1" 
                                            runat="server" 
                                            AutoExpandColumn="Name" 
                                            StoreID="Store1"
                                            Border="false">
                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                <Columns>
                                                    <ext:Column ColumnID="Name" DataIndex="Name" Header="Name" />
                                                    <ext:Column ColumnID="Status" DataIndex="Status" Header="Status" />
                                                </Columns>
                                            </ColumnModel>
                                            
                                            <BottomBar>
                                                <ext:PagingToolBar 
                                                    ID="PagingToolBar1" 
                                                    runat="server" 
                                                    PageSize="10" 
                                                    StoreID="Store1" 
                                                    />
                                            </BottomBar>
                                            <LoadMask ShowMask="true" />
                                        </ext:GridPanel>
    and Group.GetGroups is a static method.
    The AJAX call is triggered but the information I get back is empty.

    My question is: what type should the data method return so that it is readable by the ext:Store object?


  2. #2

    RE: [CLOSED] Wrong response when trying to use an ObjectDataSource

    Hi alexp,

    It can be any object which can be handled with reflection for getting properties.

    What type return GetGroups?

    May be you can post your example which we can run and test.

    Try to handle LoadException event. May be error occurs during data retrieving.


  3. #3

    RE: [CLOSED] Wrong response when trying to use an ObjectDataSource

    Thanks for the very quick answer,
    it turns out the bug was somewhere else.

    And by the way, if works great if I return standard data types such as DataSet or DataTable.

Similar Threads

  1. Replies: 0
    Last Post: Aug 05, 2012, 10:46 AM
  2. [CLOSED] Global exception handling - wrong response or no failure
    By pschojer in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 13, 2010, 2:03 PM
  3. [CLOSED] Is it possible to use a Form with an ObjectDatasource?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 04, 2010, 10:04 AM
  4. Replies: 2
    Last Post: Feb 14, 2009, 2:50 AM
  5. [CLOSED] Problems with asp:ObjectDataSource
    By antonyn in forum 1.x Legacy Premium Help
    Replies: 0
    Last Post: Feb 02, 2009, 10:50 AM

Posting Permissions