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: RE: Re[2]: [cgmo-webcgm] Issue: addEventListener


I think that an onLoad event needs to be installed somehow with the viewer
rather than with the document.

Consider the following (assuming that the addEventListener method is moved
up
to the metafile interface:

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

        function init()
        {
                var cgmDoc      =
document.getElementById("ivx1").getWebCGMDocument();
                cgmDoc.src      = 'first.cgm';
                cgmDoc.addEventListener( "load", handleLoad );
                cgmDoc.src      = 'second.cgm';        }
</script>

As of now, handleLoad wouldn't be called for first.cgm, and it would be
removed
by closing first.cgm before opening second.cgm, so it wouldn't be called for
second.cgm either, right?

It would be good to know how the SVG folks handle this case.
Some solution might be to install a default handler with the viewer,
and the viewer installs it on the opening document as early as possible.

Dieter

-----Original Message-----
From: Ulrich Laesche [mailto:ulrich@ematek.de]
Sent: Monday, March 21, 2005 4:24 PM
To: cgmo-webcgm@lists.oasis-open.org
Subject: FW: Re[2]: [cgmo-webcgm] Issue: addEventListener


Sorry, I hit the wrong reply button.


-----Original Message-----
From: Benoit Bezaire [mailto:benoit@itedo.com]
Sent: Montag, 21. Marz 2005 15:58
To: Ulrich Laesche
Subject: Re[2]: [cgmo-webcgm] Issue: addEventListener

Hi Ulrich,

I was wondering if you could CC the group? I want to CC the group (I
think they should be involved). Do you mind resending, and doing a
reply all.

--
 Benoit   mailto:benoit@itedo.com


Monday, March 21, 2005, 8:15:37 AM, Ulrich wrote:

UL> Hi Benoit,

UL> Once installed, the event handler should be triggered on a Reload
Picture
UL> occurrance, right?  Still, this doesn't solve the problem you described
UL> below (unless you want to load an image twice to execute some onload
UL> actions).

UL> So far, we (Ematek) always assumed the onload event handler in the
script
UL> being present by default (like in your SVG sample).  Apparently the spec
now
UL> says that no event handler is present by default and that it needs to be
UL> installed prior to become active.

UL> We could assume that the load action is not finished before the second
line
UL> of the script is recognized (when moving the load handler to the
Metafile
UL> interface, cgmDoc.addEventListener( "load", handleLoad )).  However,
this is
UL> mere speculation and may work or not depending on the implementation or
UL> performance.

UL> What does the SVG standard propose in this respect?  As the Event
handling
UL> mechanism should work with all other events the onload should either be
UL> handled the same way (with some reasonable behavior assumptions) or
become a
UL> different method.

UL> Regards
UL> Ulrich


UL> -----Original Message-----
UL> From: Benoit Bezaire [mailto:benoit@itedo.com]
UL> Sent: Donnerstag, 17. Marz 2005 18:41
UL> To: CGMO WebCGM TC
UL> Subject: [cgmo-webcgm] Issue: addEventListener

UL> Hi CGMO,

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

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

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

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

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

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

UL>   Assuming the source file was set on the <object> tag and that the
UL>   addEventListener method was on the WebCGMMetafile, would the
UL>   following code work?

UL>       function init()
UL>         {
UL>                 var cgmDoc      =
UL> document.getElementById("ivx1").getWebCGMDocument();
UL>                 cgmDoc.addEventListener( "load", handleLoad );
UL>         }

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

UL>   Is there a way to catch the 'load' event in a WebCGM viewer
UL>   implementation?

UL> --
UL>  Benoit                 mailto:benoit@itedo.com





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