You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Jérôme Serré <je...@gmail.com> on 2011/01/15 09:51:20 UTC

2.0

Hello,
 
With WTKXSerializer i could get an id in other file by using “.”
In 2.0 it’s not possible. How can I get it with “namespace” ?
I don’t see example in tutorial
 
Thank you for your help
Jérôme
 
Example :
wtkxSerializer.get("menuPrincipale.administration");
 
<wtkx:include wtkx:id="menuPrincipale" src="menuPrincipale.wtkx"/>
“menuPrincipale.wtkx”
…
<MenuBar.Item wtkx:id="administration" buttonData="%administration">
…
 
____________________________
La gestion de votre cave
 <http://85.216.59.161:8000/cave> http://85.216.59.161:8000/cave
 


RE: 2.0

Posted by Jérôme Serré <je...@gmail.com>.
Thank you very much

-----Message d'origine-----
De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : lundi 17 janvier 2011 14:01
À : user@pivot.apache.org
Objet : Re: <include> 2.0

Sure. Let's say your include's root element was a BoxPane that had a
PushButton with ID "myButton". If your include's ID was myInclude, you could
formerly refer to the button via "myInclude.myButton".

In Pivot 2.0, you can still name your include "myInclude", but "myButton"
isn't visible because it is private to the include's namespace. So, you can
create a custom class that extends BoxPane (e.g. MyBoxPane) and use it as
the root element of your include. If you define a getMyButton() method on
MyBoxPane that returns myButton, you can then use the "myInclude.myButton"
path to retrieve it.

Hope that helps.

G

On Jan 17, 2011, at 5:18 AM, Jérôme Serré wrote:

> I 'am not sure to understand what do you mean.
> Could you give me a small example please if it's not too much to ask ?
> 
> Thank you
> Jérôme
> 
> -----Message d'origine-----
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : samedi 15 janvier 2011 13:41
> À : user@pivot.apache.org
> Objet : Re: <include> 2.0
> 
> The dot notation now works with included objects the same way it works
with
> other values defined within the document - it refers to the properties of
> the object rather than the namespace of the document that defined the
> object. This helps preserve encapsulation and promotes the notion of
> documents as individual modules with their own private namespace.
> 
> You can replicate the previous behavior by defining a property on the root
> object of your include that exposes the named value.
> 
> G
> 
> On Jan 15, 2011, at 3:51 AM, Jérôme Serré wrote:
> 
>> Hello,
>> 
>> With WTKXSerializer i could get an id in other file by using “.”
>> In 2.0 it’s not possible. How can I get it with “namespace” ?
>> I don’t see example in tutorial
>> 
>> Thank you for your help
>> Jérôme
>> 
>> Example :
>> wtkxSerializer.get("menuPrincipale.administration");
>> 
>> <wtkx:include wtkx:id="menuPrincipale" src="menuPrincipale.wtkx"/>
>> “menuPrincipale.wtkx”
>> …
>> <MenuBar.Item wtkx:id="administration" buttonData="%administration">
>> …
>> 
>> ____________________________
>> La gestion de votre cave
>> <http://85.216.59.161:8000/cave> http://85.216.59.161:8000/cave
>> 
>> 
> 


Re: 2.0

Posted by Greg Brown <gk...@verizon.net>.
Sure. Let's say your include's root element was a BoxPane that had a PushButton with ID "myButton". If your include's ID was myInclude, you could formerly refer to the button via "myInclude.myButton".

In Pivot 2.0, you can still name your include "myInclude", but "myButton" isn't visible because it is private to the include's namespace. So, you can create a custom class that extends BoxPane (e.g. MyBoxPane) and use it as the root element of your include. If you define a getMyButton() method on MyBoxPane that returns myButton, you can then use the "myInclude.myButton" path to retrieve it.

Hope that helps.

G

On Jan 17, 2011, at 5:18 AM, Jérôme Serré wrote:

> I 'am not sure to understand what do you mean.
> Could you give me a small example please if it's not too much to ask ?
> 
> Thank you
> Jérôme
> 
> -----Message d'origine-----
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : samedi 15 janvier 2011 13:41
> À : user@pivot.apache.org
> Objet : Re: <include> 2.0
> 
> The dot notation now works with included objects the same way it works with
> other values defined within the document - it refers to the properties of
> the object rather than the namespace of the document that defined the
> object. This helps preserve encapsulation and promotes the notion of
> documents as individual modules with their own private namespace.
> 
> You can replicate the previous behavior by defining a property on the root
> object of your include that exposes the named value.
> 
> G
> 
> On Jan 15, 2011, at 3:51 AM, Jérôme Serré wrote:
> 
>> Hello,
>> 
>> With WTKXSerializer i could get an id in other file by using “.”
>> In 2.0 it’s not possible. How can I get it with “namespace” ?
>> I don’t see example in tutorial
>> 
>> Thank you for your help
>> Jérôme
>> 
>> Example :
>> wtkxSerializer.get("menuPrincipale.administration");
>> 
>> <wtkx:include wtkx:id="menuPrincipale" src="menuPrincipale.wtkx"/>
>> “menuPrincipale.wtkx”
>> …
>> <MenuBar.Item wtkx:id="administration" buttonData="%administration">
>> …
>> 
>> ____________________________
>> La gestion de votre cave
>> <http://85.216.59.161:8000/cave> http://85.216.59.161:8000/cave
>> 
>> 
> 


RE: 2.0

Posted by Jérôme Serré <je...@gmail.com>.
I 'am not sure to understand what do you mean.
Could you give me a small example please if it's not too much to ask ?

Thank you
Jérôme

-----Message d'origine-----
De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : samedi 15 janvier 2011 13:41
À : user@pivot.apache.org
Objet : Re: <include> 2.0

The dot notation now works with included objects the same way it works with
other values defined within the document - it refers to the properties of
the object rather than the namespace of the document that defined the
object. This helps preserve encapsulation and promotes the notion of
documents as individual modules with their own private namespace.

You can replicate the previous behavior by defining a property on the root
object of your include that exposes the named value.

G

On Jan 15, 2011, at 3:51 AM, Jérôme Serré wrote:

> Hello,
> 
> With WTKXSerializer i could get an id in other file by using “.”
> In 2.0 it’s not possible. How can I get it with “namespace” ?
> I don’t see example in tutorial
> 
> Thank you for your help
> Jérôme
> 
> Example :
> wtkxSerializer.get("menuPrincipale.administration");
> 
> <wtkx:include wtkx:id="menuPrincipale" src="menuPrincipale.wtkx"/>
> “menuPrincipale.wtkx”
> …
> <MenuBar.Item wtkx:id="administration" buttonData="%administration">
> …
> 
> ____________________________
> La gestion de votre cave
> <http://85.216.59.161:8000/cave> http://85.216.59.161:8000/cave
> 
> 


Re: 2.0

Posted by Greg Brown <gk...@verizon.net>.
The dot notation now works with included objects the same way it works with other values defined within the document - it refers to the properties of the object rather than the namespace of the document that defined the object. This helps preserve encapsulation and promotes the notion of documents as individual modules with their own private namespace.

You can replicate the previous behavior by defining a property on the root object of your include that exposes the named value.

G

On Jan 15, 2011, at 3:51 AM, Jérôme Serré wrote:

> Hello,
> 
> With WTKXSerializer i could get an id in other file by using “.”
> In 2.0 it’s not possible. How can I get it with “namespace” ?
> I don’t see example in tutorial
> 
> Thank you for your help
> Jérôme
> 
> Example :
> wtkxSerializer.get("menuPrincipale.administration");
> 
> <wtkx:include wtkx:id="menuPrincipale" src="menuPrincipale.wtkx"/>
> “menuPrincipale.wtkx”
> …
> <MenuBar.Item wtkx:id="administration" buttonData="%administration">
> …
> 
> ____________________________
> La gestion de votre cave
> <http://85.216.59.161:8000/cave> http://85.216.59.161:8000/cave
> 
>