| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <!-- $Id$ --> |
| <html> |
| <head> |
| <title>ActionLink</title> |
| <link rel="stylesheet" type="text/css" href="Tapestry.css" title="style"> |
| </head> |
| |
| <body> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td> |
| <td align="middle"> </td> |
| <td align="right"><A href="Any.html"><IMG alt=Any src="common-images/next.png"></a></td> |
| <tr> |
| <tr> |
| <td colspan="3"><hr></td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <table border="0" cellpadding="4" cellspacing="4" width="100%"> |
| |
| <tr valign="top"> |
| <td> |
| <table> |
| <tr> |
| <td><font size="+2"><b>ActionLink</b></font></td> |
| </tr> |
| <tr> |
| <td> |
| <A href="../api/org/apache/tapestry/link/ActionLink.html">org.apache.tapestry.link.ActionLink</a> |
| </td> |
| </tr> |
| </table> |
| </td> |
| <td> |
| <table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8"> |
| <tr> |
| <td><A href="ActionLink.html"><font color="blue">Action Link</font></a></td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| |
| <tr valign="center"> |
| <td colspan="2"> </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>Description</b> |
| <br> |
| Creates an <a> hyperlink in the HTML response. If the link is |
| triggered, then the ActionLink retrieves its listener, and invokes |
| <tt>actionTriggered()</tt> on it. |
| <p> |
| See the Developers Guide |
| <A href="../DevelopersGuide/cycle.listeners.html">ActionLink and DirectLink listeners</a> for |
| a more complete description.</p> |
| |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>See Also</b> |
| <br> |
| <A href="DirectLink.html">DirectLink</a>, |
| <A href="ExternalLink.html">ExternalLink</a>, |
| <A href="GenericLink.html">GenericLink</a>, |
| <a href="PageLink.html">PageLink</a>, |
| <a href="ServiceLink.html">ServiceLink</a> |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>Parameters</b> |
| <br> |
| <table border="1" cellpadding="4" cellspacing="4" class="parameters"> |
| <tr> |
| <th>Name</th> |
| <th>Type</th> |
| <th>Direction</th> |
| <th>Required</th> |
| <th>Default</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td>listener</td> |
| <td> |
| <A href="../api/org/apache/tapestry/IActionListener.html"><tt>IActionListener</tt></a> |
| </td> |
| <td>in</td> |
| <td>yes</td> |
| <td> </td> |
| <td>Specifies an object that is notified when the link is clicked, |
| which is typically a listener method of its container |
| (for example, <tt>listeners.<i>method</i></tt>).</td> |
| </tr> |
| <tr> |
| <td>disabled</td> |
| <td>boolean</td> |
| <td>in</td> |
| <td>no</td> |
| <td>false</td> |
| <td>Controls whether the link is produced. If disabled, the portion of the |
| template the link surrounds is still rendered, but not the link itself. |
| </td> |
| </tr> |
| <tr> |
| <td>stateful</td> |
| <td>boolean</td> |
| <td>in</td> |
| <td>no</td> |
| <td>true</td> |
| <td> |
| If true (the default), then the component requires an active (i.e., non-new) |
| <tt>HttpSession</tt> when triggered. Failing that, it throws a |
| <A href="../api/org/apache/tapestry/StaleLinkException.html"><tt>StaleLinkException</tt></a>. |
| If false, then no check is necessary. The |
| latter works well with links that encode all necessary state inside the URL |
| itself. |
| </td> |
| </tr> |
| |
| <tr> |
| <td>anchor</td> |
| <td>String</td> |
| <td>in</td> |
| <td>no</td> |
| <td> </td> |
| <td> |
| The name of an anchor or element to link to. The final URL will have '#' |
| and the anchor appended to it. |
| </td> |
| </tr> |
| |
| <tr> |
| <td>renderer</td> |
| <td><a href="../api/org/apache/tapestry/link/ILinkRenderer.html">ILinkRenderer</a></td> |
| <td>in</td> |
| <td>no</td> |
| <td> </td> |
| <td> |
| The object which will actually render the link. |
| </td> |
| </tr> |
| </table> |
| <P> |
| Body: <STRONG>rendered</STRONG><BR> |
| Informal parameters: <STRONG>allowed</STRONG><br> |
| Reserved parameters: "href" |
| </P> |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2"> |
| <b>Examples</b> |
| <p> |
| <p> |
| In this example the ActionLink component enables users to select a Customer |
| from the Customer List table. |
| <p> |
| |
| <table class="tapestry-examples" cellspacing="6"> |
| <tr align="left"> |
| <th>ID</th> |
| <th> </th> |
| <th>Name</th> |
| <th> </th> |
| <th>Level</th> |
| </tr> |
| <tr> |
| <td colspan="5"><hr></td> |
| </tr> |
| <tr> |
| <td>10276</td> |
| <td> </td> |
| <td><a href="ActionLink.html" style="{color:blue;}">Ms Sophie L. Jamies</a></td> |
| <td> </td> |
| <td>Platinum</td> |
| </tr> |
| <tr> |
| <td>10539</td> |
| <td> </td> |
| <td><a href="ActionLink.html" style="{color:blue;}">Mr Albert H. Davies</a></td> |
| <td> </td> |
| <td>Gold</td> |
| </tr> |
| <tr> |
| <td>10552</td> |
| <td> </td> |
| <td><a href="ActionLink.html" style="{color:blue;}">Mrs Jan S. Flawson</a></td> |
| <td> </td> |
| <td>Gold</td> |
| </tr> |
| <tr> |
| <td>10863</td> |
| <td> </td> |
| <td><a href="ActionLink.html" style="{color:blue;}">Mr Robert J. Hassel</a></td> |
| <td> </td> |
| <td>Silver</td> |
| </tr> |
| </table> |
| |
| <pre> |
| <table cellspacing="6"> |
| <tr> |
| <td>ID</td> |
| <td>&nbsp;</td> |
| <td>Name</td> |
| <td>&nbsp;</td> |
| <td>Level</td> |
| </tr> |
| <tr> |
| <td colspan="5"><hr></td> |
| </tr> |
| <tr jwcid="@<a href="Foreach.html">Foreach</a>" source="ognl:customerList" value="ognl:customer" element="tr"> |
| <td><span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:customer.id"/></td> |
| <td>&nbsp;</td> |
| <td><span jwcid="<span class="jwcid">@<a href="ActionLink.html">ActionLink</a></span>" listener="ognl:listeners.customerSelectAction"> <span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:customer.fullName"/> </span></td> |
| <td>&nbsp;</td> |
| <td><span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:customer.memberLevel"/></td> |
| </tr> |
| </table> |
| |
| <property-specification name="customerList" type="java.util.List" persistent="yes"/><br><property-specification name="customer" type="Customer"/><br> |
| public abstract class SalesPage extends BasePage { |
| public abstract List getCustomerList(); |
| public abstract List setCustomerList(List value); |
| |
| public abstract Customer getCustomer(); |
| |
| public void customerSelectAction(IRequestCycle cycle) { |
| Customer customer = getCustomer(); |
| // Do something with customer |
| } |
| } |
| |
| public class Customer implements Serializable { |
| private Integer id; |
| private String fullName; |
| private String memberLevel; |
| |
| public Customer(Integer id, String fullName, String memberLevel) { |
| this.id = id; |
| this.fullName = fullName; |
| this.memberLevel = memberLevel; |
| } |
| |
| public Integer getId() { return id; } |
| |
| public String getFullName() { return fullName; } |
| |
| public String getMemberLevel() { return memberLevel; } |
| } |
| </pre> |
| </td> |
| </tr></table> |
| </td></tr> |
| <tr> |
| <td colspan="3"><hr></td> |
| </tr> |
| <tr> |
| <td align="left"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td> |
| <td align="middle"> </td> |
| <td align="right"><A href="Any.html"><IMG alt=Any src="common-images/next.png"></a></td> |
| </tr> |
| </table> |
| |
| </body> |
| </html> |