Welcome Guest Search | Active Topics | Sign In | Register

Error when Inserting Link into HTML Editor control Options
Fernando De Gasperis
Posted: Wednesday, March 25, 2009 3:14:59 PM
Rank: Newbie
Groups: Member

Joined: 12/4/2008
Posts: 5
When the user clicks on the InsertLink button of the Editor control, it throw the following exception:

"childNodes is null or not an object"

This happens:

- when the user clicks the InsertLink button, the window popups up and the user clicks on the OK button.

OR

- if the user highlights a piece of text (such as a url) and clicks on the InsertLink button. In this case the InsertLink window won't even pop up as the exception is thrown right away.

Thank you,

Fernando



Here is the ascx code:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HtmlEditor.ascx.cs" Inherits="SennDelaney.Controls.HtmlEditor" %>
<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>
<asp:Table ID="DropDownTable" runat="server">
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right">
<asp:Label ID="layoutLabel" runat="server" Text="layout:" CssClass="tbltxtbold"></asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="LayoutDropDown" runat="server" Font-Size="Smaller" Width="240px"></asp:DropDownList>
</asp:TableCell>
<asp:TableCell>
<asp:Button ID="LoadLayoutButton" runat="server" Font-Size="Smaller" Text="Load..." onclick="LoadLayoutButton_Click" onclientclick="return confirmLoadLayout();" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="ReplacementFieldRow" runat="server">
<asp:TableCell HorizontalAlign="Right">
<asp:Label ID="Label2" runat="server" Text="replacement field:" CssClass="tbltxtbold"></asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="FieldDropDown" runat="server" Font-Size="Smaller" Width="188px">
<asp:ListItem>[Select one]</asp:ListItem>
<asp:ListItem>{PARTICIPANTNAME}</asp:ListItem>
<asp:ListItem>{COMPANYNAME}</asp:ListItem>
<asp:ListItem>{SESSIONNAME}</asp:ListItem>
<asp:ListItem>{SESSIONSTARTDATE}</asp:ListItem>
<asp:ListItem>{SESSIONENDDATE}</asp:ListItem>
<asp:ListItem>{LEADERNAME}</asp:ListItem>
<asp:ListItem>{CONSULTANTNAME}</asp:ListItem>
<asp:ListItem>{RELATIONSHIP}</asp:ListItem>
<asp:ListItem>{ACTIVITYENDDATE}</asp:ListItem>
<asp:ListItem>{ACTIVITYDUEDATE}</asp:ListItem>
<asp:ListItem>{LOGINLINK}</asp:ListItem>
<asp:ListItem>{SURVEYLINK}</asp:ListItem>
<asp:ListItem>{LOGININFO}</asp:ListItem>
</asp:DropDownList>
</asp:TableCell>
<asp:TableCell>
<input id="InsertFieldButton" name="InsertFieldButton" type="button" value="Insert" onclick="return InsertField();"/>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<br />
<eo:Editor ID="Editor1" runat="server" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
FooterVisible="False" Height="500px" HighlightColor="255, 255, 192"
ToolBarSet="Custom" Width="680px" EnableKeyboardNavigation="True"
Enabled="False" ColorPickerID="ColorPicker1" Font-Names="Verdana"
PasteFilter="TextWithLineBreak">
<FooterStyle CssText="background-color:#f8f8f8;border-bottom-color:gray;border-bottom-style:solid;border-bottom-width:1px;border-left-color:gray;border-left-style:solid;border-left-width:1px;border-right-color:gray;border-right-style:solid;border-right-width:1px;border-top-color:gray;border-top-width:1px;padding-bottom:3px;padding-left:3px;padding-right:3px;padding-top:3px;" />
<BreadcrumbItemStyle CssText="border-right: darkgray 1px solid; padding-right: 3px; border-top: darkgray 1px solid; margin-top: 1px; padding-left: 3px; font-size: 12px; padding-bottom: 1px; border-left: darkgray 1px solid; padding-top: 1px; border-bottom: darkgray 1px solid; font-family: tahoma" />
<EmoticonStyle CssText="background-color:white;border-bottom-color:#c5d3ed;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#c5d3ed;border-left-style:solid;border-left-width:1px;border-right-color:#c5d3ed;border-right-style:solid;border-right-width:1px;border-top-color:#c5d3ed;border-top-style:solid;border-top-width:1px;padding-bottom:2px;padding-left:2px;padding-right:2px;padding-top:2px;" />
<BreadcrumbItemHoverStyle CssText="border-right: darkgray 1px solid; padding-right: 3px; border-top: darkgray 1px solid; margin-top: 1px; padding-left: 3px; font-size: 12px; padding-bottom: 1px; border-left: darkgray 1px solid; padding-top: 1px; border-bottom: darkgray 1px solid; font-family: tahoma; background-color:#e0e0e0;" />
<BreadcrumbItemSeparatorStyle CssText="width: 3px; height: 10px" />
<EmoticonDropDownStyle CssText="background-color:#f8f8f8;border-bottom-color:#d6d5d9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#d6d5d9;border-left-style:solid;border-left-width:1px;border-right-color:#d6d5d9;border-right-style:solid;border-right-width:1px;border-top-color:#d6d5d9;border-top-style:solid;border-top-width:1px;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;" />
<BreadcrumbLabelStyle CssText="padding-right: 6px; padding-left: 6px; font-size: 12px; padding-top: 1px; font-family: tahoma" />
<CustomHeaderTemplate>
<div style="OVERFLOW-Y: hidden; HEIGHT: 27px">
<eo:ToolBar runat="server" BackgroundImage="00100403" BackgroundImageLeft="00100401" BackgroundImageRight="00100402" SeparatorImage="00100404" Width="100%">
<Items>
<eo:ToolBarItem CommandName="ForeColor" ImageUrl="00101029" ToolTip="Fore Color" Type="DropDownMenu" />
<eo:ToolBarItem CommandName="Bold" ImageUrl="00101011" ToolTip="Bold" />
<eo:ToolBarItem CommandName="Italic" ImageUrl="00101012" ToolTip="Italic" />
<eo:ToolBarItem Type="Separator" />
<eo:ToolBarItem CommandName="InsertOrEditLink" ImageUrl="00101021"
ToolTip="Insert Link">
</eo:ToolBarItem>
<eo:ToolBarItem Type="Separator"></eo:ToolBarItem>
<eo:ToolBarItem CommandName="AlignLeft" ImageUrl="00101014" ToolTip="Align Left"></eo:ToolBarItem>
<eo:ToolBarItem CommandName="AlignCenter" ImageUrl="00101015" ToolTip="Align Center">
</eo:ToolBarItem>
<eo:ToolBarItem CommandName="AlignRight" ImageUrl="00101016" ToolTip="Align Right">
</eo:ToolBarItem>
<eo:ToolBarItem CommandName="AlignJustify" ImageUrl="00101017" ToolTip="Align Justify">
</eo:ToolBarItem>
<eo:ToolBarItem Type="Separator">
</eo:ToolBarItem>
<eo:ToolBarItem CommandName="BulletList" ImageUrl="00101019" ToolTip="Bullet List">
</eo:ToolBarItem>
<eo:ToolBarItem CommandName="NumberedList" ImageUrl="00101020" ToolTip="Numbered List">
</eo:ToolBarItem>
<eo:ToolBarItem Type="Separator">
</eo:ToolBarItem>
<eo:ToolBarItem CommandName="Indent" ImageUrl="00101027" ToolTip="Indent">
</eo:ToolBarItem>
<eo:ToolBarItem CommandName="Outdent" ImageUrl="00101028" ToolTip="Outdent">
</eo:ToolBarItem>
<eo:ToolBarItem Type="Separator">
</eo:ToolBarItem>
</Items>
<itemtemplates>
<eo:ToolBarItem Type="Custom">
<normalstyle csstext="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;background-image:url('Blank');" />
<hoverstyle csstext="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;background-image:url('Blank');" />
<downstyle csstext="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;background-image:url('Blank');" />
</eo:ToolBarItem>
<eo:ToolBarItem Type="DropDownMenu">
<normalstyle csstext="background-image:url('00100409');PADDING-RIGHT: 7px; PADDING-LEFT: 7px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; CURSOR: hand; PADDING-TOP: 4px; FONT-FAMILY: Tahoma" />
<hoverstyle csstext="background-image:url('00100407');cursor:hand;font-family:Tahoma;font-size:12px;padding-bottom:4px;padding-left:7px;padding-right:7px;padding-top:4px;" />
<downstyle csstext="background-image:url('00100408');cursor:hand;font-family:Tahoma;font-size:12px;padding-bottom:4px;padding-left:7px;padding-right:7px;padding-top:4px;" />
</eo:ToolBarItem>
</itemtemplates>
<normalstyle csstext="PADDING-RIGHT: 7px; PADDING-LEFT: 7px; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; CURSOR: hand; PADDING-TOP: 4px; FONT-FAMILY: Tahoma" />
<hoverstyle csstext="background-image:url('00100405');cursor:hand;font-family:Tahoma;font-size:12px;padding-bottom:4px;padding-left:7px;padding-right:7px;padding-top:4px;" />
<downstyle csstext="background-image:url('00100406');cursor:hand;font-family:Tahoma;font-size:12px;padding-bottom:4px;padding-left:7px;padding-right:7px;padding-top:4px;" />
</eo:ToolBar>
</div>
</CustomHeaderTemplate>
<BreadcrumbDropDownStyle CssText="border-top: gray 1px solid; border-right: gray 1px solid; padding-right: 2px; border-top: gray 1px; padding-left: 2px; padding-bottom: 2px; border-left: gray 1px solid; padding-top: 2px; border-bottom: gray 1px solid; background-color: #fafafa" />
<TabButtonStyles>
<NormalStyle CssText="font-family:Verdana;font-size:12px;padding-bottom:3px;padding-left:5px;padding-right:5px;padding-top:3px;" />
<HoverStyle CssText="background-color:#e0e0e0;border-bottom-color:#a7a6aa;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#a7a6aa;border-left-style:solid;border-left-width:1px;border-right-color:#a7a6aa;border-right-style:solid;border-right-width:1px;border-top-color:#a7a6aa;border-top-style:solid;border-top-width:1px;font-family:Verdana;font-size:12px;padding-bottom:2px;padding-left:4px;padding-right:4px;padding-top:2px;" />
<SelectedStyle CssText="border-bottom-color:#a7a6aa;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#a7a6aa;border-left-style:solid;border-left-width:1px;border-right-color:#a7a6aa;border-right-style:solid;border-right-width:1px;border-top-color:#a7a6aa;border-top-style:solid;border-top-width:1px;font-family:Verdana;font-size:12px;padding-bottom:2px;padding-left:4px;padding-right:4px;padding-top:2px;" />
</TabButtonStyles>
<EditAreaStyle CssText="border-right: #a7a6aa 1px solid; padding-right: 0px; border-top: #a7a6aa 1px solid; padding-left: 0px; padding-bottom: 0px; border-left: #a7a6aa 1px solid; padding-top: 0px; border-bottom: #a7a6aa 1px solid" />
</eo:Editor>
&nbsp;&nbsp;<asp:TextBox ID="TextBox1" runat="server" Height="500px" Visible="False"
Width="680px" TextMode="MultiLine"></asp:TextBox>
<eo:ColorPicker ID="ColorPicker1" runat="server" ControlSkinID="None">
<PopupStyle CssText="border-right: #999999 1px solid; border-top: #999999 1px solid; font-size: 10pt; border-left: #999999 1px solid; color: #0751b8; border-bottom: #999999 1px solid; font-family: arial; background-color: white" />
<TextBoxStyle CssText="border-right: #7f9db9 1px solid; border-top: #7f9db9 1px solid; border-left: #7f9db9 1px solid; border-bottom: #7f9db9 1px solid" />
</eo:ColorPicker>

<script type="text/javascript" language="javascript">
function confirmLoadLayout()
{
return confirm("Are you sure you want to discard the current content and load content from the selected layout?");
}
function InsertField()
{
var index = document.getElementById('<%=FieldDropDown.ClientID%>').selectedIndex;
var fieldName = document.getElementById('<%=FieldDropDown.ClientID%>')[index].value;
<%if(this.IsTextOnly){%>
var myField = document.getElementById("<%=TextBox1.ClientID%>");
if (document.selection)
{
myField.focus();
sel = document.selection.createRange();
sel.text = fieldName;
}
else if (myField.selectionStart || myField.selectionStart == "0")
{
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ fieldName
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += fieldName;
}
<%}else{%>
if(index != 0)
{
<%=Editor1.ClientID%>.execCommand('InsertHTML', fieldName)
return 0;
}
<%}%>
}
</script>








eo_support
Posted: Wednesday, March 25, 2009 9:01:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We tested this feature and it works fine. We are not able to run your code because it is not complete. Can you provide a full test page that would run independently and still reproduce the problem?

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.