CuteEditor stealing focus?

Last post 05-19-2006, 8:11 PM by asafpriel. 12 replies.
Sort Posts: Previous Next
  •  07-11-2005, 9:42 PM 8594

    CuteEditor stealing focus?

    I just upgraded to 4.5.0.1 and I'm now having a problem where CuteEditor is stealing focus from my popups. For example, I click on a button, a popup opens, and then the underlying page with CuteEditor refocuses,  hiding the popup behind it.

    Any ideas?
  •  07-12-2005, 12:25 AM 8599 in reply to 8594

    Re: CuteEditor stealing focus?

    This behavior is by design.
     
    When the editor page loads, Cute Editor will not steal your page focus.

    if you want the editor takes the focus when the editor page loads, please set the Editor.Focus Property to true.

    Editor.Focus PropertySpecifies whether the editor grabs focus when the page loads. If this property is set to true then the editor will take focus, if it is set to false it will not.
     
    However if you open a editor popups, the CuteEditor will think you are working with the content. So when you close the popups, the editor will automatically take focus.
     
    Hope it helps.
     
    If it doesn't make sense to you, please let me know.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-12-2005, 10:05 AM 8616 in reply to 8599

    Re: CuteEditor stealing focus?

    Well, I don't know what to say. The popup window does not have an instance of CuteEditor. I happen to have Editor.Focus = False  on my page load for both of my CuteEditor instances. I've tried the following two methods to open a popup window;

    1) RegisterClientScriptBlock("clientScript", "<script language=""javascript"">var w=window.open('AddLinks.aspx?id=" & intID & "'); w.self.focus();</script>") 
    2) RegisterClientScriptBlock("clientScript", "<script language=""javascript"">window.open('AddLinks.aspx?id=" & intID & "');</script>").

    They both popup fine, but then dissapear under the previous window with the CuteEditor instances. And while it doesn't seem either CuteEditor instance has focus, this behaviour started when I upgraded from the last 4.0.0.x version to 4.5.0.1.
  •  09-30-2005, 11:14 AM 11234 in reply to 8616

    Re: CuteEditor stealing focus?

    This problem still exists in version 5.

    For anyone else having this problem, I grossly hacked a javascript fix;

    <!-- Inject Script Filtered --> <!-- Inject Script Filtered --><script language="javascript">function pause(mil) { date = new Date(); var cDate = null; do { var cDate = new Date(); } while (cDate-date < mil); }</script><script language="javascript">pause(1000);window.focus();</script>

    It essentially "pauses" the popup window, giving time for the parent window to finish stealing focus (even when cuteeditor is set to not have focus) and then refocuses the popup window. Crude, but effective.
  •  10-20-2005, 1:17 PM 11890 in reply to 11234

    Re: CuteEditor stealing focus?

    I'm using version 4 but I've seened to have narrowed down this issue.  It is when you have an image in the editor, then even when Editor.Focus = false, it still steals focus.  Hope this helps you narrow down this bug.  Thanks.
     
    Jon
  •  10-20-2005, 5:43 PM 11897 in reply to 11890

    Re: CuteEditor stealing focus?

    Jon,
     
    This issue has been resolved in the version 5.0.
     
    Can you upgrade to the latest version?


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-01-2006, 8:50 PM 15464 in reply to 11897

    Re: CuteEditor stealing focus?

    Hmm.. it's stealing focus.. in 5.1.

    I've set a preceding textbox to txtBox.Focus() and Editor1.Focus=False and it still steals focus.

    David

  •  02-02-2006, 1:02 AM 15468 in reply to 15464

    Re: CuteEditor stealing focus?

    David,

    I believe the issue has been resolved in the version 5.1.
     
    Please test the following link:
     
    http://cutesoft.net/example/general.aspx

    However the demo is runing 5.2.

    You can download it from:

    http://cutesoft.net/Downloads/default.aspx


     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-16-2006, 1:28 AM 19177 in reply to 15468

    Re: CuteEditor stealing focus?

    I have Cute Editor 5.2. Have many other controls on page and two CuteEditor on same page. I have seen that as i set focus it is set correctly (to other controls) on postback but after 0.5 sec (time needed to complete loading cuteeditors) it steals focus and set it to nowhere. I have tried to apply all solutions above but doesn't help.
     
    Any other ideas ?
     
    Best regards 
  •  05-18-2006, 12:52 PM 19283 in reply to 19177

    Re: CuteEditor stealing focus?

    Hi,
     
    I'm not sure if it would do any harm, but I've changed the file WinIE.js in the CuteEditor directory as follows:
     
    Search for the follwing code:
    Ox435[OxO4680[0x17]].focus()
     
    put it on remark.
     
    it worked for me.
  •  05-19-2006, 1:01 AM 19320 in reply to 19283

    Re: CuteEditor stealing focus?

    Hi,
     
    very thank yout for your answer. Can you please send some code before that line and after it. Brcause it will be easier to find which fosus to comment (it seems like name are not equal).
     
    Best regards,
     
    MilolosC
  •  05-19-2006, 8:11 PM 19352 in reply to 19320

    Re: CuteEditor stealing focus?

    My previous solution has created some problems.
     
    I spent a lot of time understanding their script and I think I finally have the right answer:
     
    In the WinIE.js file you will find a function called: FixActiveTabUI()
    there is a switch case that goes over the editor Tabs (i.e. Edit, Html, Preview)
     
    The first case check the Edit tab and fires a method: editor.FocusDocument()
    this method is ignoring the "Focus" attribute of the Cute Editor Object.
     
    I've found that in other places of their code, they are using the following check before calling this method:
     
    if(Ox435[OxO69e3[0x209]]){                     // checking the cute editor Focus attribute (true/false)
       if(!Ox435[OxO69e3[0xa]].hasFocus()){    // checking if the object has focus already
          editor.FocusDocument() ;                   // call the focus method
       }
    }

    So I used the same checking before FocusDocument()  in each case (I also found that they are using the FocusDocumnet only for the "Edit tab" and the "Html Tab")

    Just to let you know:
    1. I use version 5.3
    2. The hex numbers are the position of their constant name in arrays. for instance:
          The first array in my file is: var OxO69e3=["prototype","vars".....
             That menas that OxO69e3[0x1] = "vars"
     
    I'm not sure if you understood everything but I hope others will and the time I've spent for fixing my trouble will be usefull for others.
     
    Asaf.
     
  •  05-19-2006, 8:11 PM 19353 in reply to 19320

    Re: CuteEditor stealing focus?

    My previous solution has created some problems.
     
    I spent a lot of time understanding their script and I think I finally have the right answer:
     
    In the WinIE.js file you will find a function called: FixActiveTabUI()
    there is a switch case that goes over the editor Tabs (i.e. Edit, Html, Preview)
     
    The first case check the Edit tab and fires a method: editor.FocusDocument()
    this method is ignoring the "Focus" attribute of the Cute Editor Object.
     
    I've found that in other places of their code, they are using the following check before calling this method:
     
    if(Ox435[OxO69e3[0x209]]){                     // checking the cute editor Focus attribute (true/false)
       if(!Ox435[OxO69e3[0xa]].hasFocus()){    // checking if the object has focus already
          editor.FocusDocument() ;                   // call the focus method
       }
    }

    So I used the same checking before FocusDocument()  in each case (I also found that they are using the FocusDocumnet only for the "Edit tab" and the "Html Tab")

    Just to let you know:
    1. I use version 5.3
    2. The hex numbers are the position of their constant name in arrays. for instance:
          The first array in my file is: var OxO69e3=["prototype","vars".....
             That menas that OxO69e3[0x1] = "vars"
     
    I'm not sure if you understood everything but I hope others will and the time I've spent for fixing my trouble will be usefull for others.
     
    Asaf.
     
View as RSS news feed in XML