[CLOSED] "'Ext.Net.Response' is null or not an object" on store save

  1. #1

    [CLOSED] "'Ext.Net.Response' is null or not an object" on store save



    Hi,

    I'm trying to call a controller to update a grid's store, but I'm getting an error window even though everything apppears to be fine. The same thing occurs on a Webservice we have that was working when we were in 0.7 but now fails.


    Is there something else I need to be returning instead of Response for this to work??


    I've posted the Controllers action below. I Omitted all of the code and just set it to always return true. It returns the following though:

    ******************************************
    Request Failure


    Status Code: 200
    Status Text: OK


    'Ext.Net.Response' is null or not an object.
    ******************************************


    [AcceptVerbs(HttpVerbs.Post)]
    public Response SaveItems(Guid? delegateID, ApprovalType approvalType)
    {
     //Removed all extra stuff to be sure it was just the response
     Response result = new Response(true);
     result.Success = true;
    
    
     return result;
    }

    
    <ext:Store ID="stoExpenseReports" 
                   runat="server" 
                   GroupField="ReportID" 
                   PruneModifiedRecords="false"
                   WarningOnDirty="false" 
                   RefreshAfterSaving="Always">
            <UpdateProxy>
                <ext:HttpWriteProxy Url="../MyController/SaveItems" Method="POST" />
            </UpdateProxy>
            <Proxy>
                <ext:HttpProxy Url="../MyController/GetAction" />
            </Proxy>
            <BaseParams>
                  **BLAH BLAH BLAH**
            </BaseParams>
            <WriteBaseParams>
                  **BLAH BLAH BLAH**
            </WriteBaseParams>
            <SortInfo Field="ReportID" Direction="ASC" />
            <Reader>
                <ext:JsonReader IDProperty="TheID" 
                                        Root="Items" 
                                        TotalProperty="Total">
                    <Fields>
                        **BLAH BLAH BLAH**
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>



  2. #2

    RE: [CLOSED] "'Ext.Net.Response' is null or not an object" on store save

    Just to clarify, this is MVC2 with Ext.Net 1.0/Extjs3.2
  3. #3

    Re: [solved]

    Hi,

    Can you create test MVC project and post it (do not include assemblies) ?
    Is the SaveItems controller action. If yes then why do you not return class inherited from ActionResult?
    Did you see Ext.NET MVC (libarary plus demo)?
    http://extnet-mvc.googlecode.com/svn/trunk/trunk


    For MVC 2 see
    http://forums.ext.net/showthread.php?7546
    Last edited by geoffrey.mcgill; Jan 07, 2011 at 4:54 PM.
  4. #4

    RE: [CLOSED] "'Ext.Net.Response' is null or not an object" on store save



    Yeah I pulled down the 1.0 version of the mvc test project today but it wasn't building for me? It was giving an error in AjaxResult.cs that the class AjaxResponse doesnt exist (in the method ExecuteResult)?

    Tried it on a coworkers computer and he had the same results.

    I was planning on returning an AjaxResult since it looked like there was something similar in the examples (DataController/DeleteCustomer action) using it. This is where AjaxResponse was though.

    I'll try and put together a sample here pretty soon.

    Thanks!


    
    
    
    public override void ExecuteResult(ControllerContext context)
    
    
    {
    
    
    AjaxResponse response = new AjaxResponse();
    
    
    response.Result = this.Result;
    
    
    if (!string.IsNullOrEmpty(this.ErrorMessage))
    
    
    {
    
    
    response.Success = false;
    
    
    response.ErrorMessage = this.ErrorMessage;
    
    
    }
    
    
    else
    
    
    {
    
    
    if (!string.IsNullOrEmpty(this.Script))
    
    
    {
    
    
    response.Script = string.Concat("<string>", this.Script);
    
    
    }
    
    
    if (this.ExtraParamsResponse.Count > 0)
    
    
    {
    
    
    response.ExtraParamsResponse = this.ExtraParamsResponse.ToJson();
    
    
    }
    
    
    }
    
    
    
    
    
    response.Return();
    
    
    }
  5. #5

    RE: [CLOSED] "'Ext.Net.Response' is null or not an object" on store save

    Hi,

    You need update Ext.NET MVC from SVN (link from the previuos post). AjaxResult class doesn't contain AjaxResponse anymore
    Just get latest code and retest
  6. #6

    RE: [CLOSED] "'Ext.Net.Response' is null or not an object" on store save

    Ok i got latest and see you guys are returning a DirectResponse now. I'm downloading the latest 1.0 source and i'll try with this code.

Similar Threads

  1. [CLOSED] Can I use Response object in a direct method call?
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 12, 2012, 11:50 AM
  2. Replies: 7
    Last Post: Aug 12, 2011, 9:39 AM
  3. Replies: 3
    Last Post: Feb 14, 2011, 6:59 AM
  4. Store Object being set to null on postback
    By wh0urdady in forum 1.x Help
    Replies: 0
    Last Post: Jun 28, 2010, 6:20 PM
  5. Replies: 6
    Last Post: Aug 28, 2009, 12:19 PM

Posting Permissions