...
In Tapestry 5.1 and later, you may use the publishParameters attribute of the @Component annotation. List one or more parameters separated by commas: those parameters of the inner/embedded component become parameters of the outer component. You should not define a parameter field in the outer component.
Code Block |
---|
lang | html |
---|
title | ContainerComponent.tml |
---|
|
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
|
...
<t:pageLink t:id="link">Page Link</t:pageLink>
|
...
Code Block |
---|
title | ContainerComponent.java |
---|
|
public class ContainerComponent{
|
...
@Component(id="link", publishParameters="page")
|
...
...
Code Block |
---|
|
<t:ContainerComponent t:id="Container" t:page="About" />
|
...
There are still cases where you want to use the "inherit:" binding prefix. For example, if you have several components that need to share a parameter, then you must do it the Tapestry 5.0 way: a true parameter on the outer component, and "inherit:" bindings on the embedded components. You can follow a similar pattern to rename a parameter in the outer component.