Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor formatting (wrapping)

...

The Component annotation is used to define the type of component, and its parameter bindings. When using Component, the template
must not define the type, and any parameter bindings are merged in:

...

Here the type of component is defined by the field type. The field name is matched against the t:id in the template. The page parameter
is set in the Java class, and the informal class parameter is set in the template. If the tag in the template was <t:pagelink>,
or if the template tag included the attribute t:type="pagelink", then you would see an exception.

...

This code pattern is used to configure peristent properties of a page before returning it; Tapestry will send a client redirect to the page to present
the data.

InjectContainer can be used inside a component or a mixin. In a component, it injects the immediate container of the component; this is often the top-level page object.

...

It's not uncommon to have two or more services that implement the exact same interface. When you inject, you might start by just identifying the
type of service to inject:

...

Environmental is different; it exposes a request-scoped, dynamically bound value

Footnote

. The term "Environmental" was chosen as the value "comes from the environment", whatever that means. A name more evocative of its function still has not occurred to the Tapestry team!

.

...

Environmentals are a form of loosely connected communication between an outer component (or even a service) and an inner component. Example: the Form
component places a FormSupport object into the environment. Other components, such as TextField, use the FormSupport when rendering to perform functions such as allocate unique control names or register client-side validations. The TextField doesn't require that the Form component be the immediate container component, or even an ancestor: a Form on one page may, indirectly, communicate with a TextField on some entirely different page. Neither component directly links to the other, the FormSupport is the conduit that connects them.

...