Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added simple code example at the top

...

Component Parameters

Component parameters are a critical aspect of Tapestry. It is not enough that an instance of a component class exists, it must be configured to do the right thing. Configuration is in terms of the parameters of the component.the primary means for a component instance and its container to communicate with each other. Parameters are used to configure component instances.

In the following example, page is a parameter of the pagelink component. The page parameter tells the pagelink component which page to go to when the user clicks on the rendered hyperlink:

Code Block

<html>
    <t:pagelink page="Index">Go Home</t:pagelink>
</html>

A component may have any number of parameters. Each parameter has a specific name, a specific Java type (which may be a primitive value), and may be optional or required.

Parameters are defined Within a component class, parameters are declared by using the @Parameter annotation on a private field.

...