[CLOSED] Ext.Net.ModelFieldCollection must have items of type 'Ext.Net.ModelField', not 'Ext.Net.FieldContainer

  1. #1

    [CLOSED] Ext.Net.ModelFieldCollection must have items of type 'Ext.Net.ModelField', not 'Ext.Net.FieldContainer

    Strange Error !!!

    <%@ 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>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Window ID="WindowDetails" runat="server" Title="Details" Icon="Comment" Height="200"
            Width="400" BodyStyle="background-color: #fff;" BodyPadding="5" Modal="true">
            <Content>
                <ext:FormPanel ID="FormPanel1" runat="server" BodyPadding="0" Border="false" Layout="FormLayout">
                    <Items>
                        <ext:FieldContainer ID="FieldContainer1" runat="server" FieldLabel="Type" Layout="HBoxLayout">
                            <Items>
                                <ext:ComboBox ID="Type" runat="server" EmptyText="Select a Type" Width="140" AllowBlank="false">
                                    <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" />
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                </ext:ComboBox>
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer2" runat="server" FieldLabel="Comments" Layout="HBoxLayout">
                            <Items>
                                <ext:TextArea ID="Comments" runat="server" Width="300" EmptyText="Please enter comments" />
                            </Items>
                        </ext:FieldContainer>
                    </Items>
                </ext:FormPanel>
            </Content>
        </ext:Window>
    </body>
    </html>
    Last edited by Daniil; Jul 17, 2012 at 1:58 PM. Reason: [CLOSED]
  2. #2
    Hi,

    No closing Fields tag here:

    Wrong
    <ext:Model runat="server">
        <Fields>
            <ext:ModelField Name="TypeId" Type="Int" />
            <ext:ModelField Name="Description" Type="String" />
    </ext:Model>
    Should be:

    Correct
    <ext:Model runat="server">
        <Fields>
            <ext:ModelField Name="TypeId" Type="Int" />
            <ext:ModelField Name="Description" Type="String" />
        </Fields>
    </ext:Model>
  3. #3
    Also, please try to avoid Content using, use Items collection because widgets inside Content are out layout logic of parent control
    Vladimir Shcheglov
    Sr. Developer
  4. #4
    My fault, thanks...

    Quote Originally Posted by Daniil View Post
    Hi,

    No closing Fields tag here:

    Wrong
    <ext:Model runat="server">
        <Fields>
            <ext:ModelField Name="TypeId" Type="Int" />
            <ext:ModelField Name="Description" Type="String" />
    </ext:Model>
    Should be:

    Correct
    <ext:Model runat="server">
        <Fields>
            <ext:ModelField Name="TypeId" Type="Int" />
            <ext:ModelField Name="Description" Type="String" />
        </Fields>
    </ext:Model>

Similar Threads

  1. [CLOSED] Field and FieldContainer layout exception in form
    By cleve in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 13, 2012, 2:04 PM
  2. Replies: 3
    Last Post: Jun 20, 2012, 6:16 PM
  3. Replies: 5
    Last Post: Apr 10, 2012, 2:38 PM
  4. [CLOSED] RecordField vs ModelField and Reconfigure vs Render
    By Sevilay Tanış in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 13, 2012, 3:20 PM
  5. Change input type based on data type
    By bjones in forum 1.x Help
    Replies: 5
    Last Post: Jan 06, 2012, 9:54 AM

Posting Permissions