pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Shea" <patr...@ps1.net>
Subject Re: How to retrieve wtkx:id?
Date Mon, 03 May 2010 22:38:13 GMT
Unfortunately I don't come from an html background. I'm just trying to reuse the same listener
for more than one component but I can't because I can't separate which is which!

This is where the id comes into play...

I don't think that any xml attribute should be hidden from the java model, they should always
be exposed.

At the very least the namedObjects map should be exposed and not be private in the serializer.

Patrick



-----Original Message-----
From: "Greg Brown" <gkbrown@mac.com>
Sent: Monday, May 3, 2010 6:24pm
To: user@pivot.apache.org
Subject: Re: How to retrieve wtkx:id?

I understand why you might expect it to work that way, especially if you are coming from HTML,
but it doesn't. Consider that Java member variables are also accessible via reflection, but
you still can't get a variable name from a class instance. WTKX isn't a DOM - it's just another
way of instantiating classes.

Hope that helps clarify things.

Greg

On May 3, 2010, at 6:16 PM, Patrick Shea wrote:

> Well, they are declared in xml as id's and used in code in get(...) so they are quite
public.
> 
> I was able to go around this by reflection but it's ugly and they should really be exposed
at the component level I think.
> 
> Patrick
> 
> -----Original Message-----
> From: "Greg Brown" <gkbrown@mac.com>
> Sent: Monday, May 3, 2010 6:07pm
> To: user@pivot.apache.org
> Subject: Re: How to retrieve wtkx:id?
> 
> No. WTKX IDs don't work like HTML IDs - they are more like variable names. Just as there
is no way to retrieve a variable name from an object instantiated in Java, there is no way
to retrieve an ID from an object declared in WTKX.
> 
> On May 3, 2010, at 10:20 AM, Patrick Shea wrote:
> 
>> Is there a way to get the wtkx:id of a given component?
>> 
>> Thanks
>> Patrick
>> 
> 
> 
> 




Mime
View raw message