A close relative of org.apache.tapestry5.corelib.components.ActionLink except in two ways. First, the event that it triggers is explicitly controlled, rather than always "action". Second, the event is triggered in its container. This allows slightly shorter URLs but also allows multiple components within the same container to generate identical URLs for common actions.
| Name | Type | Flags | Default | Default Prefix | Description |
|---|---|---|---|---|---|
| anchor | String | NOT Allow Null | literal | An anchor value to append to the generated URL (the hash separator will be added automatically). | |
| context | Object | NOT Allow Null | prop | The context for the link (optional parameter). This list of values will be converted into strings and included in the URI. The strings will be coerced back to whatever their values are and made available to event handler methods. | |
| disabled | boolean | NOT Allow Null | false | prop | If true, then then no link element is rendered (and no informal parameters as well). The body is, however, still rendered. |
| event | String | NOT Allow Null | literal | The name of the event to be triggered in the parent component. Defaults to the id of the component. An org.apache.tapestry5.corelib.components.ActionLink triggers an "action" event on itself, and EventLink component triggers any arbitrary event on its container. | |
| zone | String | NOT Allow Null | literal | Binding the zone parameter turns the link into a an Ajax control that causes the related zone to be updated. |
<thead xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<tr>
<th t:type="Loop" source="columnNames" value="columnName">
<a t:id="sort">${columnModel.label}</a>
<a t:id="sort2">
<img src="${icon}" id="${columnModel.id}:sort" class="t-sort-icon" alt="${iconLabel}"/>
</a>
</th>
</tr>
</thead>
public class GridColumns
{
. . .
@Component(parameters = {"event=sort", "context=columnModel.id"})
private EventLink _sort, _sort2;
void onSort(String columnId)
{
if (columnId.equals(_sortColumnId))
{
_sortAscending = !_sortAscending;
}
else
{
_sortColumnId = columnId;
_sortAscending = true;
}
}
}The event parameter is often omitted; it defaults to the component's id ... you will often specify the component id, or a specific event name, but not both.