Problem with Editor.Text reset and image gallery - reproduced with demo

Last post 01-13-2008, 4:29 PM by dr. beat. 4 replies.
Sort Posts: Previous Next
  •  01-02-2008, 6:17 PM 36122

    Problem with Editor.Text reset and image gallery - reproduced with demo

    Hi,
     
    I'm having a problem with the implementation of image selection. See this demo:
     


    Basically, if you try to change an image and then cancel out of the gallery popup, the Editor.Text property has already been reset and is now empty so the original image no longer displays. VERY CONFUSING TO USERS! To reproduce, go to the demo referenced above, then:

    1. Click on Change Image
    2. Click on a new image, say Cindy Crawford :-)
    3. The gallery popup closes and Cindy is now gracing the screen
    4. Click on Change Image again, but this time do not select a new image but rather click Cancel
    5. The gallery popup closes and voila, Cindy is gone
     
    It actually appears to me, though I'm not certain, that the Editor.Text property is reset prior to the popup opening so that when it closes nothing is displayed in the control.
     
    It may well be possible to fix this by hacking around in the various and sundry nested JavaScript calls, but that may take hours to reverse-engineer. Some help would be appreciated.
     
    Running CE v6 on FireFox 2.0.0.11 on WinXP SP2.
     
    Regards,
    Greg

  •  01-03-2008, 4:15 PM 36154 in reply to 36122

    Re: Problem with Editor.Text reset and image gallery - reproduced with demo

    Greg,
     
    How is the code of the above example:
     
                            function callInsertImage() 
                            { 
                           var editor1 = document.getElementById('<%=editor.ClientID%>');
                                    editor1.FocusDocument(); 
                                    var editdoc = editor1.GetDocument();  
                                    editor1.ExecCommand('new');
                                    editor1.ExecCommand('ImageGalleryByBrowsing');
                                    InputURL();
                                    document.getElementById("imageFld").focus();
                            }   
                           
                            function InputURL()
                            {
                          var editor1 = document.getElementById('<%=editor.ClientID%>');
                                var editdoc = editor1.GetDocument(); 
                                var imgs = editdoc.getElementsByTagName("img");
                                if(imgs.length>0) 
                                { document.getElementById("imageFld").value = imgs[imgs.length-1].src;
                                } 
                                else
                                {
                           setTimeout(InputURL,500);
                                } 
                            } 

    Before open the image gallery dialog, the editor text area is reset.
     
    This example just shows you how to use the javaScript API to use the editor as an image selecctor. You can modify the above code to meet your own requirements.

    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

  •  01-05-2008, 2:46 PM 36168 in reply to 36154

    Re: Problem with Editor.Text reset and image gallery - reproduced with demo

    Adam,
     
    Thanks for pointing out where in the code I should look. I'll take a look through the JavaScript API
    to see if I can get it to work the way I need it to.
     
    Regards,
    Greg

  •  01-13-2008, 4:18 PM 36273 in reply to 36122

    Re: Problem with Editor.Text reset and image gallery - reproduced with demo

    Hi Adam,

    I have now spent two hours looking through the code as you suggest.

    First let me say that my expectation of support, especially when I
    pay $200 for a piece of software, is for you to assist me with this
    problem and not simply refer me to a scant one-page in your docs on
    "API Integration" and some poorly-documented, sample use only code.

    Back to the problem, I've removed the line you highlight so that
    the control's New method is not executed. Great, so my existing image
    stays displayed as the gallery is opened. But now, when an image is
    clicked on the gallery, it is APPENDED to the control causing multiple
    images to display. That is not the desired behavior.

    WHAT I WANT - AND THIS IS VERY SIMPLE GALLERY BEHAVIOR:
    - From my page displaying image
    - Click a button to open gallery
    - Click a new image
    - Close gallery and replace the existing image

    YOU CAN HARDLY SAY YOU HAVE A GALLERY FEATURE and not support this
    rudimentary level of functionality. Expecting me to slog through
    code and implement at my time and expense when you sold me the
    software already and advertised this as a feature is absolutely
    ridiculous.

    I look forward to receiving some support here.

    Greg
  •  01-13-2008, 4:29 PM 36274 in reply to 36122

    Re: Problem with Editor.Text reset and image gallery - reproduced with demo

    Forgot to mention. Yes, I've found the point in the gallery code (Line 156):
     
    s = s & "<img onclick=""parent.insert(this.src)""


    However I can find NO reference to parent.insert in your "API documentation" or
    elsewhere in the code. I am guessing this is a call to the parent windw's DOM that
    adds a reference to the image, but again since there is no documentation of what
    is happening here, I need some further guidance. Obviously additional javascript
    calls must be begin made (to close the popup window, etc.) but again without
    proper documentation on "API integration" how am I supposed to infer what is
    happening?
View as RSS news feed in XML