You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Noel Grandin <no...@gmail.com> on 2009/04/10 21:51:30 UTC

wtkx files, include, and IDs

Hi

I just got bitten by an unexpected problem. I had 2 files like this:
first file:
  <Window>
    <wtkx:include "other.wtkx"/>
  </Window>

other.wtkx:
  <Border>
    <TreeView wtkx:id="myid" />
  </Border>

Now, when I load this, the identifier "myid" is not visible anywhere.
This is because I failed to specify a namespace for the included file.

This took me quite a while to work out, because my mental model of
include says that the default is that the included file is fully
visible, which should mean that the identifiers are visible from
getObjectByName().

I suggest that either
(a) if I include a file without a namespace, and I specify
identifiers, an error should be thrown
or
(b) if I include a file without a namespace, identifiers should be
visible from getObjectByName()

Regards,  Noel Grandin

Re: wtkx files, include, and IDs

Posted by Todd Volkert <tv...@gmail.com>.
I'll leave this one to Greg since he wrote WTKXSerializer.  FYI, I
think he's gone all weekend.

On Fri, Apr 10, 2009 at 3:51 PM, Noel Grandin <no...@gmail.com> wrote:
> Hi
>
> I just got bitten by an unexpected problem. I had 2 files like this:
> first file:
>  <Window>
>    <wtkx:include "other.wtkx"/>
>  </Window>
>
> other.wtkx:
>  <Border>
>    <TreeView wtkx:id="myid" />
>  </Border>
>
> Now, when I load this, the identifier "myid" is not visible anywhere.
> This is because I failed to specify a namespace for the included file.
>
> This took me quite a while to work out, because my mental model of
> include says that the default is that the included file is fully
> visible, which should mean that the identifiers are visible from
> getObjectByName().
>
> I suggest that either
> (a) if I include a file without a namespace, and I specify
> identifiers, an error should be thrown
> or
> (b) if I include a file without a namespace, identifiers should be
> visible from getObjectByName()
>
> Regards,  Noel Grandin
>

Re: wtkx files, include, and IDs

Posted by Noel Grandin <no...@gmail.com>.
>
> I prefer (a). As a developer, I don't think I'd expect it to behave like (b). Can you enter a JIRA issue for this?

(b) is what fits my mental model from working in C/C++.
But opinions may vary :-)

Re: wtkx files, include, and IDs

Posted by Greg Brown <gk...@mac.com>.
>I suggest that either
>(a) if I include a file without a namespace, and I specify
>identifiers, an error should be thrown
>or
>(b) if I include a file without a namespace, identifiers should be
>visible from getObjectByName()

I prefer (a). As a developer, I don't think I'd expect it to behave like (b). Can you enter a JIRA issue for this?
Thanks,
Greg