Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Quick question about loading images using the WebThumbnailViewer.OpenURL method...

Last post 20 Dec 2007, 11:19 AM by DMann. 11 replies.
Sort Posts: Previous Next
  •  29 Oct 2007, 4:06 PM 12717

    Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    Hello again.  David, thank you so much for all your great responses; I appreciate you answering my previous posts, as well.

     Perhaps you or someone else could share some insight on a small issue I'm having.  We've added get next and previous document buttons to our project so that we can move backward and forward between document images in our "work queues." 

     When we load the documents using the WebThumbnailViewer1.OpenURL(strDocPath) method, the document image and thumbnails load up just fine.  It also selects the first page of the multi page documents, however, therein lies the issue.  When it loads in the first page of the image, it appears to load it twice, back to back.  The problem is that on a slow connection, this takes a lot longer than it should.

     Is this an intended behavior the OpenURL method of the WebThumbnailViewer?  I noticed on the Atalasoft website demo (which is using version 4, not 5 of DotImage, btw), images load in with any thumbnails being selected and the WebImageViewer area being blank.

     Thanks again for any insight you can give into this issue!

     
    --David

     

  •  02 Dec 2007, 12:51 AM 12826 in reply to 12717

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    In most cases we've seen, if the images are loading twice, it's because of a JavaScript event that's firing multiple times.

    It can also happen if you select a thumbnail in the WebThumbnailViewer after you've already opened the same image in the WebImageViewer/WebAnnotationViewer.  If the WebThumbnailViewer you're using is bound to the WebImageViewer, and any images are selected, it will auto-load the selected image on page load... there is no need to open the first image in the WebImageViewer, as the WebThumbnailViewer is controlling what it loads.


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  05 Dec 2007, 10:23 AM 12834 in reply to 12826

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    Thank you again for a great response, David.

     One thing I'd like to point out is that there is no way to determine when OpenURL has completed its task.  This means that I don't know when to call the WebThumbnailViewer.SelectThumb(x) AFTER OpenURL runs.  I believe this is what is causing the double loading of images.

    If there were a WebThumbnailViewer.Loaded event or something like that that I could check, that would be perfect.  Something to indicate that the thumbnails have been loaded, so now I'm free to invoke the .SelectThumb(x) method.

     --David
     

  •  06 Dec 2007, 10:13 AM 12838 in reply to 12834

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    Actually, there is a way... whe WebThumbnailViewer.UrlChanged JavaScript event is fired after the asynchronous callback has completed.  This is probably what you want to use.
    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  06 Dec 2007, 2:35 PM 12842 in reply to 12838

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    I actually tried that, but the double-loading still appears.  That was the first thing I tried to get the "ordering" of events properly lined up.

    Thanks for the suggestion, though!
     

  •  06 Dec 2007, 4:06 PM 12843 in reply to 12842

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    What version of DotImage are you using?  Version 4.0 fires the UrlChanged event before it gets a response from the server.
    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  06 Dec 2007, 4:19 PM 12844 in reply to 12843

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    We're using version 5.0f, which everyone here is thoroughly impressed with for its speed and capabilities.

     

    --David

     

  •  13 Dec 2007, 11:01 AM 12873 in reply to 12844

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    I'm happy you are pleased with both the speed and it's capabilities :) 

    I'm not really sure why this would happen.  If you're only opening the image using the WebThumbnailViewer, and you are not forcing the WebImageViewer to update the image (using Update()), then the only thing I can think of is that maybe something else on the page is causing a reflow.

    A reflow is when something in the DOM is changed significanty enough so that it appears to refresh an entire area of the page (sometimes the whole page), without actually doing a postback or a full refresh.  Finding the object that causes this can be difficult if there are many DOM elements on the page.  This reflow can cause the WebImageViewer to think it needs to repaint the image.

    I find that it's usually easiest to isolate the WebImageViewer(s) and WebThumbnailViewer(s) in a separate test case page, where no other HTML elements are used (except for the body tag).  If this test case reproduces the problem, you can send us the application in a support case, and we can troubleshoot it further.  If it doesn't happen in this scenario, you can start adding pieces of the HTML back, to single out the problem object. 


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  13 Dec 2007, 2:57 PM 12878 in reply to 12873

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    I'll see about setting up a test case, then.  There are a lot of DOM objects on the page, no doubt, and I had considered the possibility of a reflow at one point because of that.  The reason I moved past that idea was because instead of updating divs on the page via the XMLHttpRequest object, DotImage seems to make use of IFrames, instead (which is a perfectly good AJAX solution, by the way--I don't know why everyone goes gaga over XMLHttpRequest for every little "AJAX" thing out there).  I guess I just figured that the IFrames simply reloaded dynamic page content without changing the DOM itself.

     Thanks for the suggestion, David!  I'll try and setup the test scenario and see where that gets me.

    --David 

  •  19 Dec 2007, 9:37 AM 12899 in reply to 12878

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    I may have stumbled upon this issue... does it only happen after you do a full postback, and change the image during that postback?

    If that's the case that you're bumping into, I've been able to reproduce it.


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  20 Dec 2007, 11:08 AM 12906 in reply to 12899

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    I'll test it and see if that is the case.  I can't remember off the top of my head, but I'll let you know as soon as I see it again.  Thanks, David!
  •  20 Dec 2007, 11:19 AM 12907 in reply to 12906

    Re: Quick question about loading images using the WebThumbnailViewer.OpenURL method...

    Just had it happen on me, and yes, I can make it happen more frequently in the manner you just described.  Are we onto something here?

     

View as RSS news feed in XML