Aug 28, 2013, 9:55 AM
[CLOSED] Form missing elements
@(Html.X().FormPanel()
.Title("Reset Password Form")
.Width(800)
.BodyPadding(5)
.Layout(LayoutType.Column)
.Items(
Html.X().FieldSet()
.ColumnWidth(0.5)
.MarginSpec("0 0 0 10")
.Title("Enter user name and new password")
.ID("RESET_PASSWORD_FORM_ID")
.Layout(LayoutType.VBox)
.LayoutConfig(new VBoxLayoutConfig { Align = VBoxAlign.Center, Pack = BoxPack.Center })
.Items(
Html.X().TextField()
.Name("Username")
.FieldLabel("User Name")
.Listeners(listeners => listeners.Blur.Fn = "fnCheckUser"),
Html.X().TextField()
.ID("NewPassword")
.Name("NewPassword")
.InputType(Ext.Net.InputType.Password)
.FieldLabel("New Password"),
Html.X().TextField()
.Name("ConfirmPassword")
.ID("ConfirmPassword")
.InputType(Ext.Net.InputType.Password)
.FieldLabel("Confirm Password")
.Listeners(listeners => listeners.Change.Fn = "fnCheckPassword"),
Html.X().Panel()
.BaseCls("x-plain")
.Layout(LayoutType.HBox)
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.Middle, Pack = BoxPack.Center })
.Height(45)
.Items(
Html.X().Button()
.ID("ACCEPT_BUTTON_ID")
.Text("Accept")
.Icon(Icon.Accept)
.Width(80)
.Margin(5)
.Disabled(true)
.DirectEvents(de =>
{
de.Click.Url = @Url.RouteUrl("AlternateApi", new { httproute = "", controller = "AccountApi", action = "ResetPassword" });
de.Click.EventMask.ShowMask = true;
de.Click.FormID = "RESET_PASSWORD_FORM_ID";
de.Click.Success = "onSuccess(result);";
de.Click.Failure = "onFailure(result);";
}),
Html.X().Button()
.Text("Cancel")
.Icon(Icon.Cancel )
.Width(80)
.Margin(5)
.Listeners(listeners => listeners.Click.Fn = "fnCancelClick")
)
)
)
)
on submitting the form I get 0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'length': object is null or undefined
and looking at the code at the break it is form.elements is null
From a previous forum post I checked and this code is not wrapped in <form> tags which was the solution then
I have an identical form which works using DirectEvents
The failure is before it hits the onSuccess and onFailure and it is before it calls the Api Controller
Any pointers?
Last edited by Daniil; Aug 28, 2013 at 10:59 AM.
Reason: [CLOSED]