Home Search Member List Faq Register Login  
UltimateEditor
Re: Possible bug found ?

Thread Starter: JonathanBisson   Started: 10-27-2005 1:52 PM   Replies: 13
 Karamasoft Support Forums » General Discussions » UltimateEditor » Re: Possible bug found ?
 Printable Version    « Previous Thread   Next Thread »
  27 Oct 2005, 1:52 PM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Possible bug found ?

I have added an event to my editor:

UltimateEditors['UltimateEditor1'].AddEventHandler('focusout', focusOut)


 function focusOut() {
    UltimateEditors['UltimateEditor1'].StoreCurrentRange();
 }

Everything seem to be good but when i'm trying to load an image to insert it to the editor.... i'm receiving a javascript error:

Here's the javascript error:

Line: 8
Char: 39874
Error: Could not complete the operation due to error 800a025e.
Code: 0
URL: http://lolcalhost/testing/addApp.aspx


  
  27 Oct 2005, 3:56 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
StoreCurrentRange method can only work on text selection. When you select images, the above error could happen. We would recommend you to use try catch statement in your JavaScript as follows:

function focusOut() {
   try {
      UltimateEditors['UltimateEditor1'].StoreCurrentRange();
   }
   catch (e) {
   }
}

  
  28 Oct 2005, 7:19 AM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Re: Possible bug found ?
Event if i'm inserting try catch it doesn't work. I'm receiving the same error. I guess that error comes from the add picture function.

I really need to store the current range when i'm focusing out, because i have a button (externally) that will add text to the editor and if i'm not saving the current range when i'm focusing out, text is added at the beginning. ....

any solution ?

  
  28 Oct 2005, 10:42 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
Did you try using focus and blur events instead of focusin and focusout events? If you place your code as a reply to this forums post, we could help you better.
  
  31 Oct 2005, 8:44 AM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Re: Possible bug found ?
didn't work as well Sad

 function UltimateEditor1_OnLoad() {
  // Need to initialise the ultimate Editor handler UltimateEditors   
['UltimateEditor1'].AddEventHandler('focus', focusIn) UltimateEditors  ['UltimateEditor1'].AddEventHandler('blur', focusOut)
}

// When user focus on the text area
function focusIn() {
} // When user is going outside the text area (losing focus)
function focusOut() {
try {
UltimateEditors['UltimateEditor1'].StoreCurrentRange();
} catch (e) { }
}

  
  31 Oct 2005, 9:56 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
We placed the above into one of our samples but we couldn't replicate the problem. Could you please specify at which specific step you are getting this error? In your previous post you mentioned about "add picture" function. Does this happend after you insert an emoticon or an image into the editor?
  
  31 Oct 2005, 10:17 AM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Re: Possible bug found ?
 Karamasoft wrote:
We placed the above into one of our samples but we couldn't replicate the problem. Could you please specify at which specific step you are getting this error? In your previous post you mentioned about "add picture" function. Does this happend after you insert an emoticon or an image into the editor?


Just try to add a picture in the editor, you will see that the image couldn't be load. I'm receiving that problem when trying to add a picture.

Like I said, the code works for everything except when i'm adding a picture. I can't add any picture with that code.

thanks.

Jonathan.

  
  31 Oct 2005, 11:02 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
You are right, we managed to replicate the problem. We did some research on this issue, it looks like the error is due to problems with Microsoft's mshtml.dll library. When you comment out UltimateEditors['UltimateEditor1'].StoreCurrentRange(); the problem goes away. Could you please let us know the reason why you want to store current range when the focus moves from the editor? Using different approaches might help resolving this issue. For example, in our ClientAPI sample we used StoreCurrentRange function in a different way. StoreCurrentRange is used there only in two places where InsertText and InsertHTML links are clicked. Please open http://www.karamasoft.com/UltimateEditor/Samples/ClientAPI/ClientAPI.aspx and do view source and look at the following:

      <a href=UltimateEditors['UltimateEditor1'].StoreCurrentRange(); var textStr = prompt('Please enter text:', 'Hello world!');UltimateEditors['UltimateEditor1'].InsertText(textStr);">InsertText(textStr)</a><br><br>
      <a href=UltimateEditors['UltimateEditor1'].StoreCurrentRange(); var htmlStr = prompt('Please enter HTML:', '&lt;b&gt;Hello world!&lt;/b&gt;');UltimateEditors['UltimateEditor1'].InsertHTML(htmlStr);">InsertHTML(htmlStr)</a><br><br>

We called StoreCurrentRange when the link is clicked to store it because when prompt function is called the focus was moving from the editor to the prompt dialog box. You might want to use a similar approach. Call StoreCurrentRange when needed instead of calling it on blur event of the editor.

If you tell us more about what exactly you are trying to achieve we could help you better. Thanks.

  
  31 Oct 2005, 12:04 PM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Re: Possible bug found ?

Thanks..

I have a dropdown with many values as well as a button. When we press the button, the value in the dropdown will be added in the text box with some tags

If i'm removing the savecurrentrange, it will be ok if i'm not changing the dropdown value but in the case that i want to change the dropdown value, the focus will go out of the textbox and when i'm gonna click add, it will be added at the beginning of the textbox. I want to keep the current range when the focus goes out in order to be able even when changing the value in my dropdown, to be inserted at the rigth spot.

I will provide all my code, you will see what the code does and what i'm trying to achief here.

thanks again.

you can find the code here : http://pastecode.com/681


  
  31 Oct 2005, 2:09 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
Please place the following if check before calling StoreCurrentRange in your focusOut function:

if (!UltimateEditors['UltimateEditor1'].ue8t) {
   UltimateEditors['UltimateEditor1'].StoreCurrentRange();
}

  
  31 Oct 2005, 2:20 PM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Re: Possible bug found ?
It has solve the problem of the adding picture but it's not inserting my text (in my dropdown) at the good place. It's just not saving the current position.

It's like putting the storecurrentrange in comment (or removed)...

That doesn't fix my problem...I really need to get the storecurrentrange function.

  
  31 Oct 2005, 2:26 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
Well, it looks like you the only workaround you can try is to get rid of your focus and blur handlers and call StoreCurrentRage function during your select box onclick and button onclick events instead. Please take a look at our ClientAPI sample InsertText and InsertHTML function calls to see how you can achieve this.
  
  31 Oct 2005, 3:24 PM
JonathanBisson is not online. Last active: 1/4/2006 2:13:54 PM JonathanBisson

Top 10 Posts
Joined on 10-25-2005
Posts 15
Re: Possible bug found ?
After trying various thing, i really need to get the onfocus out event.

If i'm inserting an event on the click of my dropdown, if the user click somewhere in the page, it will lose focus and the text won't be inserted at the right spot.

I have tried to do the onClick in the body but now, when i'm clicking the button to add the text, it's calling the event so if i'm changing my value in the dropdown, it will place the good position but when i'll click on the button, it will overwrite the good position to the one that is out of focus (that mean it will be stored at the beggining).

I need to have an event that will be trigger EVERYTHING except the button i need to press.

I don't belive there a hole lot i need to do if i can't use the on focus out...

I don't know what's happening behind the scene so i can't really try to debug why I am getting that error when i have the focus out and storecurrentrange.

jonathan.

  
  31 Oct 2005, 3:57 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Possible bug found ?
You can cancel the event bubbling for your button as follows:

<BUTTON onclick="window.event.cancelBubble = true;" type="button">Add Dynamic</BUTTON>

This would stop propagating onclick event of the button and the onclick event of body would not be called.

  
 Page 1 of 1 (14 items)
Karamasoft Support Forums » General Discussions » UltimateEditor » Re: Possible bug found ?

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2021 Karamasoft LLC. All rights reserved.