PDA

View Full Version : [CLOSED] Ext.net 2v Beta Release: DisplayField don't wrap text.



supera
Mar 26, 2012, 1:17 PM
Hi

In sample bellow, the displayfield don´t show all text:
I think that I don´t set a approprieted property to Wrap text...

3998



<%@ Page Language="vb" %>
<%@ 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></title>
</head>
<body>
<ext:ResourceManager ID="resManagerDividas" runat="server" Locale="pt-BR" />
<form id="form1" runat="server">
<ext:FieldSet runat="server" ID="fsSolicitacao" Title="Solicitação de Cotação de Preços" Layout="AbsoluteLayout" Height="105px" Width="470px" Cls="my-fieldset">
<Defaults>
<ext:Parameter Name="LabelAlign" Value="top" Mode="Value" />
</Defaults>
<Items>
<ext:TextField runat="server" ID="txt1" FieldLabel="Label" x="0" Y="0" Width="120"/>
<ext:DisplayField runat="server" ID="dsMsg" X="5" Y="55" Width="440px" Height="80px" LabelWidth="440" text="*Encerrada a data de validade da senha, o usuário terá que pedir uma nova senha para o administrador. Deixe em branco esta data se a senha do usuário nunca expirar."/>
</Items>
</ext:FieldSet>
</form>
</body>
</html>

Daniil
Mar 26, 2012, 2:01 PM
Hi,

Confirmed, this

LabelAlign="Top"
with empty FieldLabel causes this problem.

Here is a simplified sample to reproduce.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string text = "";
for (int i = 0; i < 50; i++)
{
text += "test ";
}

this.DisplayField1.Text = text;
}
</script>

<!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>Ext.Net v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:DisplayField
ID="DisplayField1"
runat="server"
Width="440"
Height="80"
LabelAlign="Top" />
</body>
</html>

For you case I can suggest to set up LabelAlign="Right" as a temporary workaround.

supera
Mar 26, 2012, 2:06 PM
Hi Daniil!

I'm setting the property LabelAlign to 'Right' and the text is missing...



<%@ Page Language="vb" %>
<%@ 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></title>
</head>
<body>
<ext:ResourceManager ID="resManagerDividas" runat="server" Locale="pt-BR" />
<form id="form1" runat="server">
<ext:FieldSet runat="server" ID="fsSolicitacao" Title="Solicitação de Cotação de Preços" Layout="AbsoluteLayout" Height="105px" Width="470px" Cls="my-fieldset">
<Defaults>
<ext:Parameter Name="LabelAlign" Value="top" Mode="Value" />
</Defaults>
<Items>
<ext:TextField runat="server" ID="txt1" FieldLabel="Label" x="0" Y="0" Width="120"/>
<ext:DisplayField runat="server" ID="dsMsg" X="5" Y="55" Width="440px" Height="80px" LabelWidth="440" LabelAlign="Right" text="*Encerrada a data de validade da senha, o usuário terá que pedir uma nova senha para o administrador. Deixe em branco esta data se a senha do usuário nunca expirar."/>
</Items>
</ext:FieldSet>
</form>
</body>
</html>

Daniil
Mar 26, 2012, 2:35 PM
I guess you test with IE. There is some additional padding in IE. If you'd increase the FieldSet Height (at least, on 20 pixels), you will see the DisplayField.

Though we are investigating a way to remove that additional padding.

Here is the example to test with. The issue appears to be reproducible in IE only.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string text = "";
for (int i = 0; i < 50; i++)
{
text += "test ";
}

this.DisplayField1.Text = text;
}
</script>

<!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>Ext.Net v2 Example</title>

<style type="text/css">
.x-ie .x-fieldset .x-fieldset-body {
padding-top: 0px;
}

.my-fieldset {
padding-top: 0px;
}
</style>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:FieldSet runat="server" Title="Title" Cls="my-fieldset">
<Items>
<ext:DisplayField
ID="DisplayField1"
runat="server"
Width="440"
Height="80" />
</Items>
</ext:FieldSet>
</body>
</html>

supera
Mar 26, 2012, 2:44 PM
Ok...
The text are centered in vertical position of middle of component....

I set the 'Height' property of displayfield to 20px and works fine...

Daniil
Mar 26, 2012, 3:05 PM
Yes, it's just middle vertical align.

Apart from increasing the FieldSet Height you can:

1. Remove the DisplayField Height.

2. Or, if you need the DisplayField Height, you can align Text on top.

Set up

Cls="my-align"
for the DisplayField.

Here the CSS rule.

<style type="text/css">
.my-align td {
vertical-align: top;
}
</style>

supera
Mar 26, 2012, 3:08 PM
Ok!

Works fine!

Thanks a lot, Daniil.