|
Rank: Advanced Member Groups: Member
Joined: 3/23/2010 Posts: 35
|
Hello, When using CustomItem in menu control, mouse click near it throws script error "'null' is null or not an object". I have attached sample page and control source to reproduce this - clicking on gray area around DropDownList raises the error. ~/App_Code/DropDownToolbar.cs:
Code: C#
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace DropDown.Toolbars
{
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
public class GenericItem<T> : EO.Web.MenuItem, ITemplate
where T : Control, new ()
{
T m_customItem;
/// <summary>
/// Initializes a new instance of the <see cref="GenericItem<T>"/> class.
/// </summary>
public GenericItem ()
{
this.CustomItem = this;
}
/// <summary>
/// Gets or sets the control.
/// </summary>
/// <value>The control.</value>
public virtual T Control
{
get
{
if (null == m_customItem)
m_customItem = new T ();
return m_customItem;
}
protected set
{
m_customItem = value;
}
}
#region ITemplate Members
/// <summary>
/// When implemented by a class, defines the <see cref="T:System.Web.UI.Control"/> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
/// </summary>
/// <param name="container">The <see cref="T:System.Web.UI.Control"/> object to contain the instances of controls from the inline template.</param>
public virtual void InstantiateIn (Control container)
{
container.Controls.Add (Control);
}
#endregion
}
/// <summary>
///
/// </summary>
public class DropDownListItem : GenericItem<System.Web.UI.WebControls.DropDownList>
{
/// <summary>
/// Initializes a new instance of the <see cref="DropDownListItem"/> class.
/// </summary>
public DropDownListItem ()
{
}
}
/// <summary>
///
/// </summary>
public class LabelItem : GenericItem<LiteralControl>
{
/// <summary>
/// Initializes a new instance of the <see cref="LabelItem"/> class.
/// </summary>
/// <param name="html">The HTML.</param>
public LabelItem (string html)
{
this.Control.Text = html;
}
}
/// <summary>
///
/// </summary>
public class ViewsList : EO.Web.Menu
{
DropDownListItem m_dropDownListItem = new DropDownListItem ();
/// <summary>
/// Initializes a new instance of the <see cref="ViewsList"/> class.
/// </summary>
public ViewsList ()
{
// This instructs menu to not render last empty td with width set to 99%
this.TopLevelItemAlign = EO.Web.TopLevelItemAlign.None;
}
/// <summary>
/// Gets the drop down list.
/// </summary>
/// <remarks>The instance for this property is created on first access and may be accessed declaratively.</remarks>
/// <value>The drop down list.</value>
protected DropDownList DropDownList
{
get
{
return m_dropDownListItem.Control;
}
}
/// <summary>
/// Raises the <see cref="E:Init"/> event.
/// </summary>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected override void OnInit (EventArgs e)
{
this.DropDownList.Width = Unit.Percentage (100);
this.DropDownList.Items.Add ("empty");
LabelItem labelItem = new LabelItem ("Sample");
this.Items.Add (labelItem);
this.Items.Add (m_dropDownListItem);
base.OnInit (e);
}
}
}
~/dropdown.aspx:
Code: HTML/ASPX
<%@ Page Language="C#" %>
<%@ Register Namespace="DropDown.Toolbars" TagPrefix="dd" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>
Sample
</title>
<style>
#eo_ele_3
{
width:300px;
background-color:Gray;
padding:10px;
}
</style>
</head>
<body runat="server">
<form runat="server">
<div style="clear:both;">
<dd:ViewsList ID="views" runat="server" />
</div>
</form>
</body>
</html>
Thanks, Laurynas
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have confirmed this to be a bug. We will fix it and provide an update build to you as soon as possible.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 3/23/2010 Posts: 35
|
Hello,
Is there any progress on this issue?
Thanks, Laurynas
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I believe we have fixed this internally but still need some more time (possibly early next week) for the new build.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have posted a new build that should resolve this issue. Please see your private message for the download location.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 3/23/2010 Posts: 35
|
Thanks, looks like the script error is gone.
|
|