[CLOSED] Form missing elements

  1. #1

    [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]
  2. #2
    I have fixed this - the ID for the form was in the fieldset rather than the formpanel

    CLOSED

    Quote Originally Posted by ATLAS View Post
    @(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?

Similar Threads

  1. [CLOSED] Info on Visual Studio intellisense missing for some elements.
    By adrianot in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 25, 2013, 5:56 AM
  2. set elements horizantly
    By Elman in forum 2.x Help
    Replies: 1
    Last Post: Jun 13, 2013, 5:36 AM
  3. [CLOSED] Adding Elements to a form dynamically
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 21, 2011, 4:33 PM
  4. [CLOSED] CompositeField - Height missing when form panel rendered hidden
    By craig2005 in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Feb 07, 2011, 2:03 PM
  5. Viewport and inner elements
    By unaltro2 in forum 1.x Help
    Replies: 0
    Last Post: Feb 01, 2011, 8:11 AM

Posting Permissions