2009/1/29  <thomas.dewe...@kodak.com>:
>
> Hi Age,
>
> Age Bosma <agebo...@gmail.com> wrote on 01/28/2009 02:43:51 PM:
>
>> Age Bosma wrote:
>>
>> > getTarget() Always gives me the referenced element if someone clicked
>> > on the 'use' element and thus e.g. the id of the rect. This is fine if
>> > someone actually clicked on the 'rect' element but I'd like to know
>> > which 'use' element was clicked (the id of the use element) if someone
>> > clicked on that.
>
>    Well you can walk up the tree from the clicked element to the
> use element.  In Batik the elements are all basically normal DOM elements
> (they should be SVGElementInstance references).  In anycase you should
> be able to use 'getParentNode()' (java) or 'parentNode' (ecmascript) to
> walk up the tree checking if the element is a use element or not.
>

The problem is that I'm unable to get to a use element. If I click on
a use element, I'm getting exactly the same back as when I click on
the element the use element is referencing (getNodeName(), getId(),
etc.). If you look at the initial e-mail describing the situation,
getNodeName() will always be 'rect' even if I click on the use
element. The same goes for the Id.

A use element does not contain any children, it only references an
element to get a clone. getParentNode() is therefor no option to get
to the use element.

Age

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Reply via email to