pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bushe <mich...@bushe.com>
Subject Re: Bindable not working?
Date Sun, 03 Jan 2010 17:55:46 GMT
OK, I think I was confusing binding and wire-up.  I have it working now by
implementing Bindable and using an include.  Thanks.

Curious - if I didn't use an include, and had @WTK fields in my subclass,
would they get wired up (I think I had that working before)?   If so, how
could I add listeners to to the @WTK fields, since I assume they would be
null until the constructor finished?

Michael Bushe
Software Architect/Developer

On Sun, Jan 3, 2010 at 11:33 AM, Greg Brown <gkbrown@mac.com> wrote:

> > Yup, making it a root element works.  I think it's strange that the
> semantics of an XML element changes at the root element.  Why not always
> call initialize for Bindable elements?
> The namespace is defined at the WTKX document level, not the element level,
> so it would be odd to bind to anything other than the root element.
> > Otherwise, what's the best way to initialize a component that's not the
> root element?
> Generally, you'd do this in the initialize() method for the root element.
> However, another option would be to create subclasses for your inner
> elements:
> <foo:MyWindow>
>    <content>
>        <foo:MyPushButton/>
>    </content>
> </foo: MyWindow>
> The MyPushButton instance won't be bound to (for the reason I mention
> above), but you can still perform initialization (e.g. event wire-up) in the
> constructor.

View raw message