PDA

View Full Version : FormPanel + GridPanel Layout Incorrect



jonasscalar
Mar 23, 2012, 2:49 PM
What is wrong??, in v1.3 this work so fine, and in v2.0 get uglly
Can help-me.


3990


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Usuarios.aspx.vb" Inherits="C.Usuarios" %>
<%@ 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 runat="server">
<title>Usuarios</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />


<ext:Panel ID="Panel2"
runat="server"
Split="true"
Region="East"
Frame="true"
Width="450"
Height="450"
>
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="Button1" runat="server" Icon="Add" Text="Adicionar F8">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().reset();" />
</Listeners>
</ext:Button>

<ext:Button ID="btnSaveRecord" runat="server" Icon="Disk" Text="Salvar F9">

</ext:Button>

<ext:Button ID="Button2" runat="server" Icon="Delete" Text="Excluir">
<DirectEvents>

</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>

<Items>

<ext:FormPanel
ID="FormPanel1"
runat="server"
Width="400"
Height="400"
>
<Items>
<ext:Hidden ID="NOME_U_ATUAL" runat="server"></ext:Hidden>
<ext:TextField FieldLabel="Nome Usuário" DataIndex="NOME_U" ID="cNOME_U" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Senha Anterior" DataIndex="SENHA_ANTERIOR" ID="cSENHA_ANTERIOR" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Senha Atual" DataIndex="SENHA_ATUAL" ID="cSENHA_ATUAL" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Permissoes" DataIndex="PERMISSOES" ID="cPERMISSOES" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" />
<ext:NumberField FieldLabel="Minutos Máximos 60 a 1440" DataIndex="MINUTOS" ID="cMINUTOS" AllowBlank="false" Width="260" MsgTarget="Under" runat="server"
EmptyText="Entre 60 e 1440"
InvalidText="Deve ser entre 60 e 1440 minutos"
DecimalPrecision="0"
MaxText="Valor Máximo 1440"
MaxValue="1440"
MinText="Valor Mínimo 60"
MinValue="60"
AllowDecimals="False"
AllowNegative="False"
/>
</Items>

<Listeners>
<ValidityChange Handler="btnSaveRecord.setDisabled(!valid);" />
</Listeners>
</ext:FormPanel>

</Items>

</ext:Panel>


<ext:Panel ID="Panel1"
runat="server"

Region="center"
Frame="true"
Width="450"
Height="450"
>


<Items>
<ext:GridPanel
runat="server"
ID="gv"
Width="400"
Height="400"
StoreID="ds"
>



<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column runat="server" DataIndex="NOME_U" Text="Nome Usuário" Width="150" />
<ext:CommandColumn ID="CommandColumn1" runat="server" Width="110">
<Commands>
<ext:GridCommand Icon="Decline" CommandName="Delete" Text="Delete" />
</Commands>
<Listeners>
<Command Handler="Ext.Msg.alert(command, record.data.NOME_U);" />
</Listeners>
</ext:CommandColumn>
</Columns>
</ColumnModel>

<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" Mode="Single">

</ext:RowSelectionModel>
</SelectionModel>
<View>
<ext:GridView ID="GridView1" runat="server" StripeRows="true" TrackOver="true" />
</View>
</ext:GridPanel>
</Items>
</ext:Panel>
</form>
</body>
</html>

Daniil
Mar 26, 2012, 9:49 PM
Hi,

I don't think the same code (ported) will work in Ext.NET v1 fine.

I guess you've missed a top level container (probably, Viewport) with Layout="BorderLayout".

jonasscalar
Mar 27, 2012, 12:46 PM
Hi,

I don't think the same code (ported) will work in Ext.NET v1 fine.

I guess you've missed a top level container (probably, Viewport) with Layout="BorderLayout".

Nothing works, i tried varios layout types, look.:


<%@ Page Language="vb" AutoEventWireup="false" Inherits="C.WebForm1" %>

<%@ 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>Usuarios</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:Panel ID="p1" runat="server" Layout="BorderLayout" Width="500" Height="600">
<Items>

<ext:FormPanel
ID="FormPanel1" runat="server" Layout="BorderLayout" Width="500" Height="600"
>
<Items>
<ext:Hidden ID="NOME_U_ATUAL" runat="server"></ext:Hidden>
<ext:TextField FieldLabel="Nome Usuário" DataIndex="NOME_U" ID="cNOME_U" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Senha Anterior" DataIndex="SENHA_ANTERIOR" ID="cSENHA_ANTERIOR" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Senha Atual" DataIndex="SENHA_ATUAL" ID="cSENHA_ATUAL" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Permissoes" DataIndex="PERMISSOES" ID="cPERMISSOES" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" />
</Items>
</ext:FormPanel>
</Items>

<TopBar>
<ext:Toolbar runat="server" ID="TOP">
<Items>

<ext:Button ID="Button1" runat="server" Icon="Add" Text="Adicionar F8">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().reset();" />
</Listeners>
</ext:Button>

<ext:Button ID="btnSaveRecord" runat="server" Icon="Disk" Text="Salvar F9">
</ext:Button>

</Items>
</ext:Toolbar>
</TopBar>
</ext:Panel>

</form>
</body>
</html>

I go to V1, to work, this beta v2 dont work. sorry.

Daniil
Mar 27, 2012, 1:09 PM
Please replace

Layout="BorderLayout"
of the FormPanel with

Region="Center"

BorderLayout requires a Center region to be set up.

jonasscalar
Mar 27, 2012, 1:22 PM
Please replace

Layout="BorderLayout"
of the FormPanel with

Region="Center"

BorderLayout requires a Center region to be set up.

I get the BUG

When i remove the Hidden Field then this work

<ext:Hidden ID="NOME_U_ATUAL" runat="server"></ext:Hidden>





<%@ Page Language="vb" AutoEventWireup="false" Inherits="C.WebForm1" %>

<%@ 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>Usuarios</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:Panel ID="p1" runat="server" Layout="BorderLayout" Width="510" Height="610">
<Items>

<ext:FormPanel
ID="FormPanel1" runat="server" Region="Center" Width="500" Height="600"
>
<Items>
<ext:Hidden ID="NOME_U_ATUAL" runat="server"></ext:Hidden>
<ext:TextField FieldLabel="Nome Usuário" DataIndex="NOME_U" ID="cNOME_U" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Senha Anterior" DataIndex="SENHA_ANTERIOR" ID="cSENHA_ANTERIOR" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Senha Atual" DataIndex="SENHA_ATUAL" ID="cSENHA_ATUAL" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" MinLength="5" MaxLength="18" MinLengthText="Minimo de 5 caracteres" MaxLengthText="Máximo de 18 caracteres" />
<ext:TextField FieldLabel="Permissoes" DataIndex="PERMISSOES" ID="cPERMISSOES" AllowBlank="false" Width="260" MsgTarget="Under" runat="server" />
</Items>
</ext:FormPanel>
</Items>

<TopBar>
<ext:Toolbar runat="server" ID="TOP">
<Items>

<ext:Button ID="Button1" runat="server" Icon="Add" Text="Adicionar F8">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().reset();" />
</Listeners>
</ext:Button>

<ext:Button ID="btnSaveRecord" runat="server" Icon="Disk" Text="Salvar F9">
</ext:Button>

</Items>
</ext:Toolbar>
</TopBar>
</ext:Panel>

</form>
</body>
</html>

Daniil
Mar 27, 2012, 4:04 PM
This bug has been already fixed. Please wait a new release.

For now, please move the HiddenField out of the FormPanel items.