PDA

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



Fahd
Jul 16, 2012, 9:14 PM
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>

Daniil
Jul 16, 2012, 9:36 PM
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>

Vladimir
Jul 16, 2012, 10:45 PM
Also, please try to avoid Content using, use Items collection because widgets inside Content are out layout logic of parent control

Fahd
Jul 17, 2012, 1:44 PM
My fault, thanks...


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>