Change Active Tab doesn't save text

Last post 08-30-2010, 3:12 AM by Kenneth. 4 replies.
Sort Posts: Previous Next
  •  08-25-2010, 3:33 PM 63618

    Change Active Tab doesn't save text

    I am using the CuteEditor and I bind my control to some data and set the view to the preview tab. When I change the tab back to normal and add text to the control and save the data the text value isn't what is in the control.
     
    Binding:
    csResultsEditor.Text = dataRow.results.Trim();
    csResultsEditor.ActiveTab = TabType.View;
     
    User then clicks on the Normal tab and adds some text anywhere in the current text. They then click save and the csResults.Text isn't what the user entered.
     
    dataRow.results = csResultsEditor.Text; //the text value isn't what is in the control
     
    If I don't set the ActiveTab in the binding and leave the control to be the normal tab and the user changes the text the text saves without any issue.
     
    Why can't I set the activetab to preview when binding my data?
     
     
  •  08-26-2010, 1:45 AM 63626 in reply to 63618

    Re: Change Active Tab doesn't save text

    Hi tgrambo,
     
    It works fine for me. Please test the example below
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Import Namespace="System.Data" %>   
    4. <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>   
    5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    6. <html xmlns="http://www.w3.org/1999/xhtml">   
    7. <head id="Head1" runat="server">   
    8.     <title>Untitled Page</title>   
    9. </head>   
    10.   
    11. <script runat="server">      
    12.     
    13.     protected override void OnLoad(EventArgs e)   
    14.     {   
    15.         if (!IsPostBack)   
    16.         {   
    17.             ViewState["content"] = "type something and click the button below";   
    18.             editor1.Text = ViewState["content"].ToString();   
    19.         }   
    20.         editor1.ActiveTab = TabType.View;   
    21.   
    22.   
    23.         base.OnLoad(e);   
    24.     }   
    25.     protected void button1_Click(object sender, EventArgs e)   
    26.     {   
    27.         ViewState["content"] = editor1.Text;   
    28.         label1.Text = ViewState["content"].ToString();   
    29.     }   
    30. </script>   
    31.   
    32. <body>   
    33.     <form id="form1" runat="server">   
    34.         <div>   
    35.             <CE:Editor ID="editor1" runat="server" CustomCulture="en-us">   
    36.             </CE:Editor>   
    37.             <asp:Button ID="button1" runat="server" Text="Get text" OnClick="button1_Click" />   
    38.             <asp:Label ID="label1" runat="server"></asp:Label>   
    39.         </div>   
    40.     </form>   
    41. </body>   
    42. </html>  
    Regards,
     
    Ken
  •  08-27-2010, 9:35 AM 63693 in reply to 63626

    Re: Change Active Tab doesn't save text

    Hi,
     
    I tried your sample page and code and it worked. I'm not sure why my code won't though. If I don't set the tab view to preview my code works as well. There must be some reason that the text value isn't what I changed it to when going to save the text. Any ideas?
  •  08-27-2010, 9:48 AM 63694 in reply to 63693

    Re: Change Active Tab doesn't save text

    If I have the tab set to normal, switch to preview and then switch back to normal, the text value doesn't save as well.
  •  08-30-2010, 3:12 AM 63717 in reply to 63694

    Re: Change Active Tab doesn't save text

    Hi tgrambo,
     
    Is your site online? If so, can you set up ftp access for me and send me the test page url? So I can check it for you.
     
    Or you can create a simple example which can reproduce this issue and send it to me. I will test it and get back to you as soon as possible.
     
    Please send the information to Kenneth@CuteSoft.net
     
    Regards,
     
    Ken
     
View as RSS news feed in XML