#2268: ASP.NET integration: FCKeditor.IsDirty() can return incorrect results
when
UpdatePanels are used
----------------------+-----------------------------------------------------
Reporter: Madferit | Type: Bug
Status: new | Priority: Normal
Milestone: | Component: General
Version: | Keywords:
----------------------+-----------------------------------------------------
If partial page rendering is made via UpdatePanels, FCKeditor.IsDirty() of
editors outside UpdatePanel that is rendered return [true]. No matter if
they are dirty or not.
'''Steps to reproduce:'''
1. 'fckeditor/' folder contents is default.
2. aspx file content:
{{{
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default"
ValidateRequest="false" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2"
TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server" />
<div>
<asp:UpdatePanel ID="updatePanel1" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<div style="border: solid 1px Black;">
Update panel 1
<FCKeditorV2:FCKeditor ID="fckEditor1"
BasePath="fckeditor/" runat="server" />
<asp:Button ID="updateButton1" runat="server"
Text="Update1"
OnClick="updateButton1_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="updatePanel2" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<div style="border: solid 1px Black;">
Update panel 2
<FCKeditorV2:FCKeditor ID="fckEditor2"
BasePath="fckeditor/" runat="server" />
<asp:Button ID="updateButton2" runat="server"
Text="Update2"
OnClick="updateButton1_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
<script type="text/javascript">
function FCKeditor_OnComplete(editorInstance)
{
editorInstance.Events.AttachEvent('OnFocus',
FCKEditor_OnFocus);
}
function FCKEditor_OnFocus(editorInstance)
{
alert(editorInstance.Name + '.IsDirty() = ' +
editorInstance.IsDirty());
}
</script>
</body>
</html>
}}}
3. codebehind file content
{{{
using System;
using System.Web.UI;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
fckEditor1.Value = DateTime.Now.ToString();
fckEditor2.Value = DateTime.Now.ToString();
}
protected void updateButton1_Click(object sender, EventArgs e)
{
}
protected void updateButton2_Click(object sender, EventArgs e)
{
}
}
}}}
3. Page loads first. Set focus to first editor - 'fckEditor1.IsDirty() =
false' alert as a result. Set focus to second editor -
'fckEditor2.IsDirty() = false' alert as a result. As expected
4. Click 'Update1' button - updatePanel1 is updated
5. Set focus to second editor - 'fckEditor2.IsDirty() = true' alert as a
result. Instead of expected 'fckEditor2.IsDirty() = false'.
FCKEditor Version: 2.6, Night build
.NET integration assembly: 2.5.2912.21007
Browsers: FF 2.0.0.14, IE 7.0.5730.11
--
Ticket URL: <http://dev.fckeditor.net/ticket/2268>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac