You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Vissers <Ja...@cumquat.nl> on 2008/04/14 18:42:51 UTC

T5 - what happend to the 'state:' binding

Is there an equivalent for state: binding in T5 and if so - how can I
use it.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 - what happend to the 'state:' binding

Posted by Jan Vissers <Ja...@cumquat.nl>.
Excellent - thank you. 
On Mon, 2008-04-14 at 11:13 -0700, Howard Lewis Ship wrote:
> The T4 state: binding was based on the fact that ASO's in T4 had
> explicit, developer-assigned logical names.
> 
> In T5, ASOs are identified by their class name, not a
> developer-assigned logical name.
> 
> You can define a field as an ASO.
> 
> If you place the @ApplicationState annotation on an additional boolean
> field (and follow the naming convention) you can determine if the ASO
> exists or not.
> 
> You can define getters, or put @Property annotation on the fields, to
> expose this information to the template and to other components.
> 
> Some people define base classes for their pages that provide the
> necessary fields, annotations and accessors.
> 
> On Mon, Apr 14, 2008 at 9:42 AM, Jan Vissers <Ja...@cumquat.nl> wrote:
> > Is there an equivalent for state: binding in T5 and if so - how can I
> >  use it.
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >  For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 - what happend to the 'state:' binding

Posted by Howard Lewis Ship <hl...@gmail.com>.
The T4 state: binding was based on the fact that ASO's in T4 had
explicit, developer-assigned logical names.

In T5, ASOs are identified by their class name, not a
developer-assigned logical name.

You can define a field as an ASO.

If you place the @ApplicationState annotation on an additional boolean
field (and follow the naming convention) you can determine if the ASO
exists or not.

You can define getters, or put @Property annotation on the fields, to
expose this information to the template and to other components.

Some people define base classes for their pages that provide the
necessary fields, annotations and accessors.

On Mon, Apr 14, 2008 at 9:42 AM, Jan Vissers <Ja...@cumquat.nl> wrote:
> Is there an equivalent for state: binding in T5 and if so - how can I
>  use it.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>  For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: T5 - what happend to the 'state:' binding

Posted by Jonathan Barker <jo...@gmail.com>.
Is it the base page issue you are tripping over?  The documentation is
pretty clear for the "standard" case.  If you are extending base pages, then
you will need to create the getters and setters to access the ASO's in
derived pages.

For access from the component, why not just inject with the
@ApplicationState annotation the same way you did for your base page?  It
makes the component more testable as a bonus.


Jonathan




> -----Original Message-----
> From: Jan Vissers [mailto:Jan.Vissers@cumquat.nl]
> Sent: Monday, April 14, 2008 1:19 PM
> To: Igor Drobiazko
> Cc: Tapestry users
> Subject: Re: T5 - what happend to the 'state:' binding
> 
> Yep I've read it - but to me it's unclear. I know I'm stupid :-)
> 
> 
> Again this is my T4 case:
> 
> + An ASO holds on to user identity
> 
> + A base page declares this ASO as well as a ASO guard to circumvent
> eager creation
> 
> + A component 'queries' the ASO guard in order to render some dynamic
> content.
> 
> + The component itself doesn't declare a reference to the ASO, but uses
> 'state:'
> 
> + The component itself uses 'page.' to get hold of the ASO in case it is
> created.
> 
> I need this use case in T5 as well - but can't seem to get the pieces
> together. Help would be appreciated!
> 
> -J.
> 
> On Mon, 2008-04-14 at 19:15 +0200, Igor Drobiazko wrote:
> > Read here about the application state:
> > http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html
> >
> > On Mon, Apr 14, 2008 at 7:09 PM, Jan Vissers <Ja...@cumquat.nl>
> > wrote:
> >         Let me explain:
> >
> >         I have an ASO defined in a Base class which is extended by a
> >         page. This
> >         page uses a component. This component should check whether the
> >         ASO has
> >         is created. In T4 my component could lookup page properties
> >         and state:
> >         binding properties very easily - somehow I'm unable to
> >         reproduce this
> >         mechnanism in T5.
> >
> >         -J.
> >
> >
> >         On Mon, 2008-04-14 at 18:42 +0200, Jan Vissers wrote:
> >         > Is there an equivalent for state: binding in T5 and if so -
> >         how can I
> >         > use it.
> >         >
> >         >
> >         >
> >         ----------------------------------------------------------------
> -----
> >         > To unsubscribe, e-mail:
> >         users-unsubscribe@tapestry.apache.org
> >         > For additional commands, e-mail:
> >         users-help@tapestry.apache.org
> >         >
> >         >
> >
> >
> >         ----------------------------------------------------------------
> -----
> >         To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >         For additional commands, e-mail:
> >         users-help@tapestry.apache.org
> >
> >
> >
> >
> >
> > --
> > Best regards,
> >
> > Igor Drobiazko
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 - what happend to the 'state:' binding

Posted by Thiago HP <th...@gmail.com>.
Try this in your component:

@ApplicationState
private YourASOClass object;

@ApplicationState
private boolean objectExists; // tells if your ASO objects has already
been created

As your login information is an application state, you don't need to
access it from the page, AFAIK.

-- 
Thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 - what happend to the 'state:' binding

Posted by Jan Vissers <Ja...@cumquat.nl>.
Yep I've read it - but to me it's unclear. I know I'm stupid :-)


Again this is my T4 case:

+ An ASO holds on to user identity

+ A base page declares this ASO as well as a ASO guard to circumvent
eager creation

+ A component 'queries' the ASO guard in order to render some dynamic
content.

+ The component itself doesn't declare a reference to the ASO, but uses
'state:' 

+ The component itself uses 'page.' to get hold of the ASO in case it is
created.

I need this use case in T5 as well - but can't seem to get the pieces
together. Help would be appreciated!

-J.

On Mon, 2008-04-14 at 19:15 +0200, Igor Drobiazko wrote:
> Read here about the application state:
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html
> 
> On Mon, Apr 14, 2008 at 7:09 PM, Jan Vissers <Ja...@cumquat.nl>
> wrote:
>         Let me explain:
>         
>         I have an ASO defined in a Base class which is extended by a
>         page. This
>         page uses a component. This component should check whether the
>         ASO has
>         is created. In T4 my component could lookup page properties
>         and state:
>         binding properties very easily - somehow I'm unable to
>         reproduce this
>         mechnanism in T5.
>         
>         -J.
>         
>         
>         On Mon, 2008-04-14 at 18:42 +0200, Jan Vissers wrote:
>         > Is there an equivalent for state: binding in T5 and if so -
>         how can I
>         > use it.
>         >
>         >
>         >
>         ---------------------------------------------------------------------
>         > To unsubscribe, e-mail:
>         users-unsubscribe@tapestry.apache.org
>         > For additional commands, e-mail:
>         users-help@tapestry.apache.org
>         >
>         >
>         
>         
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>         For additional commands, e-mail:
>         users-help@tapestry.apache.org
>         
>         
> 
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 - what happend to the 'state:' binding

Posted by Igor Drobiazko <ig...@gmail.com>.
Read here about the application state:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html

On Mon, Apr 14, 2008 at 7:09 PM, Jan Vissers <Ja...@cumquat.nl> wrote:

> Let me explain:
>
> I have an ASO defined in a Base class which is extended by a page. This
> page uses a component. This component should check whether the ASO has
> is created. In T4 my component could lookup page properties and state:
> binding properties very easily - somehow I'm unable to reproduce this
> mechnanism in T5.
>
> -J.
>
> On Mon, 2008-04-14 at 18:42 +0200, Jan Vissers wrote:
> > Is there an equivalent for state: binding in T5 and if so - how can I
> > use it.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko

Re: T5 - what happend to the 'state:' binding

Posted by Jan Vissers <Ja...@cumquat.nl>.
Similarly - to be complete -

The component in T4 reference a page property via 'page.XYZ....' 
Would like to know how 'page.' is achieved in T5.

-J.

On Mon, 2008-04-14 at 19:09 +0200, Jan Vissers wrote:
> Let me explain:
> 
> I have an ASO defined in a Base class which is extended by a page. This
> page uses a component. This component should check whether the ASO has
> is created. In T4 my component could lookup page properties and state:
> binding properties very easily - somehow I'm unable to reproduce this
> mechnanism in T5.
> 
> -J.
> 
> On Mon, 2008-04-14 at 18:42 +0200, Jan Vissers wrote:
> > Is there an equivalent for state: binding in T5 and if so - how can I
> > use it.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 - what happend to the 'state:' binding

Posted by Jan Vissers <Ja...@cumquat.nl>.
Let me explain:

I have an ASO defined in a Base class which is extended by a page. This
page uses a component. This component should check whether the ASO has
is created. In T4 my component could lookup page properties and state:
binding properties very easily - somehow I'm unable to reproduce this
mechnanism in T5.

-J.

On Mon, 2008-04-14 at 18:42 +0200, Jan Vissers wrote:
> Is there an equivalent for state: binding in T5 and if so - how can I
> use it.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org