You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Christophe Cordenier <ch...@gmail.com> on 2010/10/28 19:05:08 UTC

Re: [CONF] Apache Tapestry > Component Cheat Sheet

Hi

I really like this concept of cheat sheet, i think they should be a
reference in fact ! And if people wants to know more they can go deeper
inside user guides.

I had a training this week, and this is not the first time that people are
surprised with AppModule class, because they do not have direct to what they
can contribute to or simply do in this class, they feel lost... That's the
reason why i have added an 'Application Module class Cheat Sheet'

2010/10/27 <co...@apache.org>

>    Component Cheat Sheet<https://cwiki.apache.org/confluence/display/TAPESTRY/Component+Cheat+Sheet> Page
> *added* by Howard M. Lewis Ship<https://cwiki.apache.org/confluence/display/~hlship>
>
> There's a lot of documentation scattered about describing the various
> annotations and methods you will add to a page. This is not an exhaustive
> list, but describes some typical things.
> Field Injection Annotations @Inject
>
> @Inject is the Swiss-Army Knife of annotation; it's designed to connect
> your component to services, resources, and other objects.
> Service Injection
>
> In most cases, the injected value is a service; the service is located by
> type. If there are ambiguities, caused by multiple services implementing the
> same interface, you'll see injection exceptions. You can resolve those
> exceptions by adding marker annotations to select a specific service, or by
> adding @Service to specify the specific service id you want.
> Use of @Service is discouraged. If marker annotations are available, that
> is preferred.
> @InjectComponent
>
> Injects a component from this component's template into this component's
> class. Injecting a component is based on the component's id, which should
> match the field name. However, the value attribute of the @InjectComponent
> annotation can be specified as well, this takes precedence over the field
> name.
>
> It is common to inject a component in order to obtain its client-side id
> (used when generating client-side JavaScript).
> @InjectContainer
>
> Injects the container of a component or, when used in a mixin, injects the
> component the mixin is attached to.
> @InjectPage
>
> Injects a page of the application. Normally, the page to inject is
> identified based on the field type. The value attribute can be specified, in
> which case the page to be injected is identified by name.
> @Environmental
>
> Injects an environmental object; such objects are request scoped but may be
> overridden at any time using the methods of the Environment service.
> Environmental objects are used to allow outer components to communicate with
> components they enclose.
>
> Most often, @Environmental is used with type JavaScriptSupport, which is
> used to add JavaScript code and libraries to the rendered page.
> Field Behavior Annotations @PageActivationContext @Parameter @Persist
> @Property @SessionState @ActivationRequestParameter Method Annotations
> @OnEvent @Log @CommitAfter @Cached Type Annotations @Events @Import
> @AllowsInformalParameters Render Phase Methods Page Lifecycle Methods
>  Change Notification Preferences<https://cwiki.apache.org/confluence/users/viewnotifications.action>
> View Online<https://cwiki.apache.org/confluence/display/TAPESTRY/Component+Cheat+Sheet>
>



-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com