Hi Nigel,

Nigel MOTTE <[EMAIL PROTECTED]> wrote on 04/17/2006 08:24:31 AM:

> in fact I use the example given on the page "Java Scripting" and I've 
> just modified it to support a file chooser and my event :
> 
> public void registerListeners() {
>          // Gets an element from the loaded document.
>          Element elt = document.getElementById("elt-id");
                                                 ^^^^^^^^
            For your sample SVG below this should be 'rect1308' so
it get's the rect you want your click event handler on.

>          EventTarget t = (EventTarget)elt;
> 
> 
>          // Adds a 'onclick' listener
>          t.addEventListener("testEvent", new OnClickAction(), false);
                               ^^^^^^
        For your example this should be just 'click'. 

> I've added  an onclick event (onclick="testEvent") on a rectangle :

    This will tell it to try and run the ECMAScript function 'testEvent'.
Simply remove this line from your SVG.


>      <rect
> /*Here is my event */
>         onclick="testEvent" <!--- delete the 'onclick' attribute -->
>         width="80"
>         height="150"
>         x="20"
>         y="30"
>         fill="red"
>         id="rect1308" />


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to