[CLOSED] Error on Form Submit - parsedResponse.result

  1. #1

    [CLOSED] Error on Form Submit - parsedResponse.result

    I am having a similar problem on a couple of forms that #i have in my web app, firebug returns:

    TypeError: parsedResponse.result is undefined

    ...cope.parseResponse(response,options);if(!Ext.isEmpty(parsedResponse.result.docum...
    
        
    ext.axd?v=33683 (line 128, col 62)
    A sample form view is
    @(Html.X().Window()
        .Width(478)
        .Height(600)
        .Icon(Icon.ApplicationFormAdd)
        .Title("Trade Loss - Additional Notes")
        .ID("TradeLossAdditionalNotesWindow")
        .Padding(10)
        .X(400)
        .Y(150)
        .CloseAction(CloseAction.Destroy)       // NEED TO MAKE THIS THE SAVE FUNCTION??
        .Items(
       Html.X().FormPanel()
        .Layout(LayoutType.VBox)
             .ID("TradeLossForm")
        .LayoutConfig(new VBoxLayoutConfig { Align = VBoxAlign.StretchMax })
        .Items(
            Html.X().Label()
            .Text("Please give further information of recorded loss.")
            .Margin(5)
            ,
            Html.X().FieldContainer()
                .Width(450)
                .MarginSpec("5 5 5 0")
                .Padding(5)
            .Items(
                Html.X().Label().Text("Additional Notes:").Width(370).Padding(5),
                Html.X().TextArea().ID("AdditionalNote").Width(445).Padding(5)                   
                )
                ,
            // submit button
                Html.X().FieldContainer()
                .Width(300)
                .MarginSpec("5 5 5 0")
                .Padding(5)
                .Items(
                    Html.X().Button()
                    .Text("Submit")
                    .DirectEvents(de =>
                        {
                            de.Click.Url = Url.Action("setTradeLossAdditionalNote");
                            de.Click.ExtraParams.Add(new Parameter("AdditionalNote", "App.AdditionalNote.getValue()", ParameterMode.Raw));
                            // extra params int RIABargainRef, string AdditionalNote
                            de.Click.Success = "App.TradeLossAdditionalNotesWindow.Close();";
                        }
                    )
    
                )
            )
        )
    )
    the controller code is

            public ActionResult setTradeLossAdditionalNote( string AdditionalNote) {
    
                TradeLossReason TradeLossReason;
    
                try
                {
                    TradeLossReason = (from ofg in db.TradeLossReason                                  
                                       select ofg).First<TradeLossReason>();
    
                    TradeLossReason.AdditionalNote = AdditionalNote;
    
                    // save changes to DB
                    db.SaveChanges();
                }
    
                catch (InvalidOperationException e)
                {
    
                    TradeLossReason = new TradeLossReason();
                    TradeLossReason.Reason = 4;                         // set this to additional note
                    TradeLossReason.AdditionalNote = AdditionalNote;
    
                    // add to DB and save changes
                    db.TradeLossReason.Add(TradeLossReason);
                    db.SaveChanges();
    
                }
    
                // Notify user of change
                X.Msg.Notify("Trade Loss Reason", "Additional Notes saved").Show();
    
                return this.Direct();
            }
    Also, as an aside, what is the best way of closing the window once the details have been submitted?

    Thanks
    Last edited by Daniil; Dec 23, 2014 at 5:34 PM. Reason: [CLOSED]
  2. #2
    Hi @OriCoder,

    Unfortunately, I cannot run the test case. Could you, please, change it that we are able to copy, paste and run it?

    Also, as an aside, what is the best way of closing the window once the details have been submitted?
    I see you try to use a Success handler. It is exactly what I would recommend to try at first. There is ".Close()" in your code. It should start with a lowercase "c" - ".close()".
  3. #3
    Sorry, I find it difficult to give simple but working examples - Its a pretty big application...

    using firebug I've found that in other areas of the app that submit successfully have values for the variables passed in to the function on line 128 of ext.axd?v=33683 while the forms which don't have no values, I've put some screen shots in which hopefully help in demonstrating this.

    Click image for larger version. 

Name:	Capture161210000.PNG 
Views:	10 
Size:	32.1 KB 
ID:	17241Click image for larger version. 

Name:	Capture16121013.PNG 
Views:	8 
Size:	29.3 KB 
ID:	17242
  4. #4
    Sorry, I find it difficult to give simple but working examples - Its a pretty big application...
    Yes, it might be not easy. This technique might help.
    How to prepare a sample

    As for the screenshots, thank you for posting them, but, unfortunately, it didn't help me to narrow down the problem.

Similar Threads

  1. Replies: 1
    Last Post: Jul 25, 2012, 9:52 AM
  2. Replies: 2
    Last Post: Aug 29, 2011, 3:53 PM
  3. Replies: 0
    Last Post: Mar 02, 2011, 4:16 PM
  4. [CLOSED] Submit gridpanel data in form submit
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 14, 2010, 7:25 PM
  5. Form Submit JS Error
    By cleve in forum 1.x Help
    Replies: 0
    Last Post: Jul 10, 2010, 3:27 AM

Tags for this Thread

Posting Permissions