OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cgmo-webcgm message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Issue: addEventListener


Hi CGMO,

  We came upon a problem while working on addEventListener... If you
  consider the following ECMAScript:

<script language="JavaScript">
        function handleLoad(evt)
        {
                window.alert( "load finished" );
        }

        function init()
        {
                var cgmDoc      = document.getElementById("ivx1").getWebCGMDocument();
                cgmDoc.src      = 'appstructure.cgm';
                cgmPic          = cgmDoc.firstPicture;

                cgmPic.addEventListener( "load", handleLoad );
        }
</script>

  The problem is that the "load" event will never be triggered because
  by the time you get to the addEventListener, the document is already
  fully loaded.

  Do people know if moving the addEventListner to the WebCGMMetafile
  interface solves the problem? Ulrich, your guys worked on this,
  right?

  Assuming the source file was set on the <object> tag and that the
  addEventListener method was on the WebCGMMetafile, would the
  following code work?
  
      function init()
        {
                var cgmDoc      = document.getElementById("ivx1").getWebCGMDocument();
                cgmDoc.addEventListener( "load", handleLoad );
        }

  I'm thinking no... I tried this with an SVG viewer and it didn't
  work (but it could be a bug). I can only get the load event to be
  tricked if the event listener is already in the SVG file:
  <svg onload="do something"...>

  Is there a way to catch the 'load' event in a WebCGM viewer
  implementation?
  
-- 
 Benoit                 mailto:benoit@itedo.com



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]