PDA

View Full Version : [OPEN] [#29] Error "tagName is null"



xeo4.it
Oct 15, 2012, 2:20 PM
Hi,
in attached sample, when I select the second value of the selectbox in the code:


App.lblCollegamentoPagina.hide();


I take the error "tagName is null"

Sample:


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


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


<script runat="server">


protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this._loadSbTipoLink();

mnCollegamentoPagina_click();
}
}


protected void mnCollegamentoPagina_click()
{
this.sbTipoLink.Select("T");


this.lblHyperlink.Hide();
this.txtHyperlink.Text = String.Empty;
this.txtHyperlink.Hide();
this.lblCollegamentoPagina.Show();
}


private void _loadSbTipoLink()
{
Ext.Net.ListItem li = null;


li = new Ext.Net.ListItem();
li.Text = "Hyperlink http";
li.Value = "H";
this.sbTipoLink.Items.Add(li);


li = new Ext.Net.ListItem();
li.Text = "Hyperlink https";
li.Value = "S";
this.sbTipoLink.Items.Add(li);


li = new Ext.Net.ListItem();
li.Text = "Tab";
li.Value = "T";
this.sbTipoLink.Items.Add(li);


this.sbTipoLink.Select(0);
}


</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 id="Head1" runat="server">
<title></title>
<script type="text/javascript">


var onSelect_sbTipoLink = function () {


var tipoL = App.sbTipoLink.getValue();


if (tipoL == 'T') {
App.lblCollegamentoPagina.show();
App.sbTabs.show();
App.lblHyperlink.hide();
App.txtHyperlink.hide();
}
else {
App.lblCollegamentoPagina.hide();
App.sbTabs.hide();
App.lblHyperlink.show();
App.txtHyperlink.show();


App.txtHyperlink.setValue("");


if (tipoL == 'H') {
App.lblHyperlink.setText("Hyperlink (http://) :");
}
else {
App.lblHyperlink.setText("Hyperlink (https://) :");
}
}
}


</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" >
</ext:ResourceManager>




<ext:Panel
id="pnlTableLayout2"
runat="server"
Border="false"
Layout="TableLayout">
<LayoutConfig>
<ext:TableLayoutConfig Columns="2"/>
</LayoutConfig>
<Items>

<ext:Label ID="lblSbTipoLink" runat="server" Text="Tipo link: " >
</ext:Label>


<ext:SelectBox ID="sbTipoLink" runat="server"
Editable="false"
SelectOnFocus="true"
TypeAhead="true"
Mode="Remote"
ForceSelection="true"
TriggerAction="All"
EmptyText="Selezionare Tipo"
ValueNotFoundText="Loading..."
Width="300px"

>
<Listeners>
<Select Handler="onSelect_sbTipoLink();" />
</Listeners>
</ext:SelectBox>


<ext:Label ID="lblCollegamentoPagina" runat="server" Text="Tab collegato:" >
</ext:Label>


<ext:Label ID="lblHyperlink" runat="server" Text="Hyperlink:">
</ext:Label>


<ext:TextField ID="txtHyperlink" runat="server" Width="420" MaxLength="255" >
</ext:TextField>


</Items>
</ext:Panel>


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


Thank you

Jimmy

Daniil
Oct 15, 2012, 2:59 PM
Hi Jimmy,

Thank you for a sample. But, when I select the second item I'm getting

App.sbTabs is undefined

I can't see the "sbTabs" definition in your code.

Could you, please, ensure the code reproduces the issue?

xeo4.it
Oct 15, 2012, 3:13 PM
Hi Daniil,
I have removed the "sbTabs", the problem occurs in IE8:



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


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


<script runat="server">


protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this._loadSbTipoLink();

mnCollegamentoPagina_click();
}
}


protected void mnCollegamentoPagina_click()
{
this.sbTipoLink.Select("T");


this.lblHyperlink.Hide();
this.txtHyperlink.Text = String.Empty;
this.txtHyperlink.Hide();
this.lblCollegamentoPagina.Show();
}


private void _loadSbTipoLink()
{
Ext.Net.ListItem li = null;


li = new Ext.Net.ListItem();
li.Text = "Hyperlink http";
li.Value = "H";
this.sbTipoLink.Items.Add(li);


li = new Ext.Net.ListItem();
li.Text = "Hyperlink https";
li.Value = "S";
this.sbTipoLink.Items.Add(li);


li = new Ext.Net.ListItem();
li.Text = "Tab";
li.Value = "T";
this.sbTipoLink.Items.Add(li);


this.sbTipoLink.Select(0);
}


</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 id="Head1" runat="server">
<title></title>
<script type="text/javascript">


var onSelect_sbTipoLink = function () {


var tipoL = App.sbTipoLink.getValue();


if (tipoL == 'T') {
App.lblCollegamentoPagina.show();

App.lblHyperlink.hide();
App.txtHyperlink.hide();
}
else {
App.lblCollegamentoPagina.hide();

App.lblHyperlink.show();
App.txtHyperlink.show();


App.txtHyperlink.setValue("");


if (tipoL == 'H') {
App.lblHyperlink.setText("Hyperlink (http://) :");
}
else {
App.lblHyperlink.setText("Hyperlink (https://) :");
}
}
}


</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" >
</ext:ResourceManager>




<ext:Panel
id="pnlTableLayout2"
runat="server"
Border="false"
Layout="TableLayout">
<LayoutConfig>
<ext:TableLayoutConfig Columns="2"/>
</LayoutConfig>
<Items>

<ext:Label ID="lblSbTipoLink" runat="server" Text="Tipo link: " >
</ext:Label>


<ext:SelectBox ID="sbTipoLink" runat="server"
Editable="false"
SelectOnFocus="true"
TypeAhead="true"
Mode="Remote"
ForceSelection="true"
TriggerAction="All"
EmptyText="Selezionare Tipo"
ValueNotFoundText="Loading..."
Width="300px"

>
<Listeners>
<Select Handler="onSelect_sbTipoLink();" />
</Listeners>
</ext:SelectBox>


<ext:Label ID="lblCollegamentoPagina" runat="server" Text="Tab collegato:" >
</ext:Label>


<ext:Label ID="lblHyperlink" runat="server" Text="Hyperlink:">
</ext:Label>


<ext:TextField ID="txtHyperlink" runat="server" Width="420" MaxLength="255" >
</ext:TextField>


</Items>
</ext:Panel>


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


Thank you

Jimmy

Daniil
Oct 15, 2012, 5:18 PM
Thank you.

It looks a bug. I reported to Sencha.
http://www.sencha.com/forum/showthread.php?246071

Generally, TableLayout is rather weak layout. Personally, I would recommend to switch to another like HBox, VBox, Anchor or its combination.

Daniil
Oct 16, 2012, 6:12 AM
Sencha opened a bug ticket. We will monitor.

Baidaly
Nov 17, 2012, 12:25 AM
Opened an Issue to track this defect, see

https://github.com/extnet/Ext.NET/issues/29