I think there are three things that need to happen each time you get more content, at least two of which are asynchronous:
1. your ajax call to get content, asynchronous
2. when you place received HTML code into document, browser will start to render HTML, but without the images yet. I believe that if you run the deferred command as suggested just after setting the HTML content into the panel, it will run when the HTML is fully rendered, but w/o any images in place
3. browser will start to load referenced images (from img tags src attributes) and other items with src, possibly in parallel with the rendering of the HTML
If you really don't want to start loading any new content until the HTML and images are fully loaded, then you would need some mechanism to know when all the images are complete. You might actually want to still use a deferred command at this point, since the point in time where images are loaded is probably earlier than the point where they are actually rendered.
You can help out the process if you control the incoming HTML, by using height and width attributes in the img tags. That way the placeholders will be sized immediately, and you wouldn't have to wait until they have loaded. Unfortunately, I believe that this gets in the way of "responsive design", since it prevents a max-width css rule from working correctly.
On Tuesday, October 21, 2014 9:13:22 AM UTC-4, sch wrote:
-- 1. your ajax call to get content, asynchronous
2. when you place received HTML code into document, browser will start to render HTML, but without the images yet. I believe that if you run the deferred command as suggested just after setting the HTML content into the panel, it will run when the HTML is fully rendered, but w/o any images in place
3. browser will start to load referenced images (from img tags src attributes) and other items with src, possibly in parallel with the rendering of the HTML
If you really don't want to start loading any new content until the HTML and images are fully loaded, then you would need some mechanism to know when all the images are complete. You might actually want to still use a deferred command at this point, since the point in time where images are loaded is probably earlier than the point where they are actually rendered.
You can help out the process if you control the incoming HTML, by using height and width attributes in the img tags. That way the placeholders will be sized immediately, and you wouldn't have to wait until they have loaded. Unfortunately, I believe that this gets in the way of "responsive design", since it prevents a max-width css rule from working correctly.
On Tuesday, October 21, 2014 9:13:22 AM UTC-4, sch wrote:
Thanks for the reply. Since we do NOT want to make a server call until the rendering is complete I am not sure if scheduleDeferred would help. Please correct if I am wrong.
On Saturday, 18 October 2014 00:42:44 UTC+5:30, Raphael Garnier wrote:Hi,Maybe you could use scheduleDeferred of Scheduler to run code when the DOM is done.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment