Opened 17 years ago

Closed 17 years ago

#2267 closed Bug (duplicate)

ASP.NET integration: FCKeditor.IsDirty() can return incorrect results when UpdatePanels are used

Reported by: Alexey Zuev Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

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>
  1. 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)
    {
    }
}
  1. 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
  1. Click 'Update1' button - updatePanel1 is updated
  1. 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

Change History (2)

comment:1 in reply to:  description Changed 17 years ago by Alexey Zuev

Sorry, this is duplicate of #2268. Can be deleted

comment:2 Changed 17 years ago by Wojciech Olchawa

Resolution: duplicate
Status: newclosed

DUP of #2268

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy