[CLOSED] When using Form Validation, I get the error below:

  1. #1

    [CLOSED] When using Form Validation, I get the error below:

    Following your example from online at the link below:
    https://examples2.ext.net/#/Form/FormPanel/Validation/

    Error: Microsoft JScript runtime error: 'this.dockedItems.get(...)' is null or not an object

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Simple Form Panel - Ext.NET Examples</title>
        <style type="text/css">
            .icon-exclamation
            {
                padding-left: 25px !important;
                background: url(/icons/exclamation-png/ext.axd) no-repeat 3px 0px !important;
            }
            
            .icon-accept
            {
                padding-left: 25px !important;
                background: url(/icons/accept-png/ext.axd) no-repeat 3px 0px !important;
            }
        </style>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <br />
        <ext:Button ID="Button1" ArrowAlign="Right" Text="Show Window" OnClientClick="#{WindowDetails}.show();"
            runat="server" />
        <ext:Window ID="WindowDetails" runat="server" Title="Details" Icon="Comment" Height="200"
            Width="400" BodyStyle="background-color: #fff;" BodyPadding="5" Modal="true"
            Hidden="true">
            <Content>
                <ext:Panel ID="Panel1" BodyBorder="0" runat="server" Layout="FitLayout">
                    <Items>
                        <ext:FormPanel ID="FormPanel1" runat="server" BodyPadding="0" Border="false" Layout="AnchorLayout">
                            <Content>
                                <ext:ComboBox ID="Type" runat="server" EmptyText="Select a Type" Width="250" AllowBlank="false"
                                    FieldLabel="Type">
                                    <Store>
                                        <ext:Store ID="TypeStore" runat="server">
                                            <Model>
                                                <ext:Model runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="TypeId" Type="Int" />
                                                        <ext:ModelField Name="Description" Type="String" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                </ext:ComboBox>
                                <ext:TextArea ID="Comments" runat="server" Width="350" FieldLabel="Comments" EmptyText="Please enter comments" />
                            </Content>
                            <BottomBar>
                                <ext:StatusBar runat="server" />
                            </BottomBar>
                            <Listeners>
                                <ValidityChange Handler="this.dockedItems.get(1).setStatus({
                                                         text : valid ? 'Form is valid' : 'Form is invalid', 
                                                         iconCls: valid ? 'icon-accept' : 'icon-exclamation'
                                                     });
                                                     #{btnUpdate}.setDisabled(!valid);" />
                            </Listeners>
                        </ext:FormPanel>
                    </Items>
                    <Buttons>
                        <ext:Button ID="btnUpdate" ArrowAlign="Right" Icon="Accept" Text="Update" Disabled="true"
                            FormBind="true" runat="server" />
                    </Buttons>
                </ext:Panel>
            </Content>
        </ext:Window>
    </body>
    </html>
    Last edited by Daniil; Jul 23, 2012 at 4:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    There is zero-based indexing. So, the first docked item has 0 index.

    I think you should replace
    this.dockedItems.get(1)
    with
    this.dockedItems.get(0)
    Also please use Items instead of Content when you place only Ext.NET controls into a container.
  3. #3
    Works... Thanks...

    Quote Originally Posted by Daniil View Post
    Hi,

    There is zero-based indexing. So, the first docked item has 0 index.

    I think you should replace
    this.dockedItems.get(1)
    with
    this.dockedItems.get(0)
    Also please use Items instead of Content when you place only Ext.NET controls into a container.

Similar Threads

  1. [CLOSED] V2.0 Validation Form Help
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 14, 2012, 2:55 PM
  2. Login form - validation form
    By LordMX in forum 1.x Help
    Replies: 0
    Last Post: Aug 14, 2011, 11:44 AM
  3. [CLOSED] RowEditor & Form Validation
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 22, 2011, 9:45 AM
  4. [CLOSED] validation form all
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 22, 2011, 8:05 PM
  5. [CLOSED] Form validation on Page_Load
    By CSG in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 08, 2009, 10:09 PM

Posting Permissions