Dec 12, 2014, 1:28 PM
[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:
Thanks
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]