Hi Joseph:

Not as familiar with SVG as I am with Canvas, but I am thinking that
you can likely (assuming I interpreted the documentation correctly)
hook into the SVG load event. Do investigate this, as I am not sure,
but below are a couple of sources. Take a look at SVGLoad, perhaps you
can use something like that instead of you doing the checking,
leverage if it's valid the callback that's native there.

http://www.w3.org/TR/SVG/interact.html

Then something like:

http://stackoverflow.com/questions/3883257/loading-svg-into-svgweb-dynamically-with-jquery

svg.addEventListener('SVGLoad', function() {
  svg = this; // this will correctly refer to your SVG root
  alert('loaded!');
}, false);
// also supported:
svg.onsvgload = function() {
  alert('loaded!');
}

Best regards,

Alfredo

On Tue, Aug 28, 2012 at 9:33 AM, Joseph Lust <lifeofl...@gmail.com> wrote:
> I wanted to ask the community's opinion on the best practice for waiting for
> a DOM resource to become available.
>
> Use Case:
> You make an elaborate component via UiBinder or injecting some HTML/SVG into
> the DOM and upon executing the following statement trying to access an
> element that was injected, the DOM does not see it (i.e. inject 2MB of SVG)
> due to DOM parsing lag.
>
> Work Arounds:
>
> Schedule recurring timer to check if the element is available and then
> continue the program flow (now that the element's accessible in the DOM).
> OR Schedule a deferred timer and then continue (less robust, does not always
> work).
>
> So, curious what other folks have been using in this case where the GWT code
> must wait to wait for DOM parsing lag time. It seems to me like this is
> something there should be an official GWT function for doing as other
> frameworks do have functions to wait until an object becomes available in
> the DOM.
>
>
> Sincerely,
> Joseph
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/JpBdhNvNWbIJ.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to