blob: cae0c806d6e187f7e90e11f2c9e8153ab22d8436 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ -->
<html>
<head>
<title>Any</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="ActionLink.html"><IMG alt=ActionLink src="common-images/prev.png"></a></td>
<td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td>
<td align="right"><A href="Block.html"><IMG alt=Block 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>Any</b></font></td>
</tr>
<tr>
<td>
<A href="../api/org/apache/tapestry/components/Any.html">org.apache.tapestry.components.Any</a>
</td>
</tr>
</table>
</td>
<td>
<table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8">
<tr>
<td>Visual / Non Visual Component</td>
</tr>
</table>
</td>
</tr>
<tr valign="center">
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<b>Description</b>
<br>
A
component that can substitute for any HTML or XML element. Informal
parameters
are used to fill in the attributes of the element.
</td>
</tr>
<tr>
<td colspan="2">
<b>See Also</b>
<br>
<A href="Insert.html">Insert</a>,
<A href="Hidden.html">Hidden</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>element</td>
<td>String</td>
<td>in</td>
<td>no</td>
<td>HTML tag used to insert this component in its parent's template.</td>
<td>The element to be produced.</td>
</tr>
</table>
<P>Body: <STRONG>rendered<BR></STRONG>Informal parameters:
<STRONG>allowed</STRONG>
<br>
Reserved parameters:
<EM>none</EM> </P>
</td>
</tr>
<tr>
<td colspan="2">
<b>Examples</b>
<p>
In this example the Any component is use to generate XML order list document.
<p>
<table class="tapestry-examples" cellpadding="8">
<tr>
<td>
<font color="blue">&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;</font><br>
<font color="blue">&lt;</font><font color="brown">order-list</font><font color="blue">&gt;</font><br>
&nbsp;<font color="blue">&lt;</font><font color="brown">order-item id</font><font color="blue">="</font><b>91307</b><font color="blue">"</font> <font color="brown">order-id</font><font color="blue">="</font><b>2137</b><font color="blue">"</font> <font color="brown">cust-id</font><font color="blue">="</font><b>94</b><font color="blue">"</font> <font color="brown">order-date</font><font color="blue">="</font><b>2002-04-13</b><font color="blue">"</font> <font color="brown">desc</font><font color="blue">="</font><b>AWB-TS 4.5mm</b><font color="blue">"</font><font color="blue">/&gt;</font><br>
&nbsp;<font color="blue">&lt;</font><font color="brown">order-item id</font><font color="blue">="</font><b>91308</b><font color="blue">"</font> <font color="brown">order-id</font><font color="blue">="</font><b>2137</b><font color="blue">"</font> <font color="brown">cust-id</font><font color="blue">="</font><b>94</b><font color="blue">"</font> <font color="brown">order-date</font><font color="blue">="</font><b>2002-04-13</b><font color="blue">"</font> <font color="brown">desc</font><font color="blue">="</font><b>TGM-M2 30mm</b><font color="blue">"</font><font color="blue">/&gt;</font><br>
&nbsp;<font color="blue">&lt;</font><font color="brown">order-item id</font><font color="blue">="</font><b>92571</b><font color="blue">"</font> <font color="brown">order-id</font><font color="blue">="</font><b>3846</b><font color="blue">"</font> <font color="brown">cust-id</font><font color="blue">="</font><b>94</b><font color="blue">"</font> <font color="brown">order-date</font><font color="blue">="</font><b>2002-05-09</b><font color="blue">"</font> <font color="brown">desc</font><font color="blue">="</font><b>AWB-TS 4.5mm</b><font color="blue">"</font><font color="blue">/&gt;</font><br>
&nbsp;<font color="blue">&lt;</font><font color="brown">order-item id</font><font color="blue">="</font><b>92572</b><font color="blue">"</font> <font color="brown">order-id</font><font color="blue">="</font><b>3846</b><font color="blue">"</font> <font color="brown">cust-id</font><font color="blue">="</font><b>94</b><font color="blue">"</font> <font color="brown">order-date</font><font color="blue">="</font><b>2002-05-09</b><font color="blue">"</font> <font color="brown">desc</font><font color="blue">="</font><b>P6-AA Series 2</b><font color="blue">"</font><font color="blue">/&gt;</font><br>
&nbsp;<font color="blue">&lt;</font><font color="brown">order-item id</font><font color="blue">="</font><b>92573</b><font color="blue">"</font> <font color="brown">order-id</font><font color="blue">="</font><b>3846</b><font color="blue">"</font> <font color="brown">cust-id</font><font color="blue">="</font><b>94</b><font color="blue">"</font> <font color="brown">order-date</font><font color="blue">="</font><b>2002-05-09</b><font color="blue">"</font> <font color="brown">desc</font><font color="blue">="</font><b>AWB-TS 10mm</b><font color="blue">"</font><font color="blue">/&gt;</font><br>
<font color="blue">&lt;/</font><font color="brown">order-list</font><font color="blue">&gt;</font><br>
</td>
</tr>
</table>
<pre>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
&lt;order-list&gt;
&lt;span jwcid="@<a href="Foreach.html">Foreach</a>" source="ognl:orderItemList" value=&quot;ognl:orderItem&quot;&gt;
&lt;order-item jwcid="<span class="jwcid">orderItem</span>"&gt;
&lt;/order-item&gt;
&lt;/span&gt;
&lt;/order-list&gt;
&lt;property-specification name=&quot;orderItemList&quot; type=&quot;java.util.List&quot;/&gt;<br>&lt;property-specification name=&quot;orderItem&quot; type=&quot;com.dsconsulting.order.model.OrderItem&quot;/&gt;<br>
&lt;component id="<span class="jwcid">orderItem</span>" type="<A href="Any.html">Any</a>"&gt;
&lt;binding name="id" expression="orderItem.id"/&gt;
&lt;binding name="order-id" expression="orderItem.orderId"/&gt;
&lt;binding name="cust-id" expression="orderItem.customerId"/&gt;
&lt;binding name="order-date" expression="orderItem.orderDate"/&gt;
&lt;binding name="desc" expression="orderItem.description"/&gt;
&lt;/component&gt;
public abstract class OrderItemsXML extends BasePage {
public abstract List getOrderItemList();
public abstract void setOrderItemList(List value);
}
public class OrderItem {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
private Integer id;
private Integer orderId;
private Integer customerId;
private Date orderDate;
private String description;
public OrderItem(Integer id, Integer orderId, Integer customerId,
Date orderdDate, String description) {
this.id = id;
this.orderId = orderId;
this.customerId = customerId;
this.orderDate = orderDate;
this.description = description;
}
public Integer getId() { return id; }
public Integer getOrderId() { return orderId; }
public Integer getCustomerId() { return customerId; }
public String getOrderDate() { return DATE_FORMAT.format(orderDate); }
public String getDescription() { return description; }
}
</pre>
</td>
</tr></table>
</td></tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td align="left"><A href="ActionLink.html"><IMG alt=ActionLink src="common-images/prev.png"></a></td>
<td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></a></td>
<td align="right"><A href="Block.html"><IMG alt=Block src="common-images/next.png"></a></td>
</tr>
</table>
</body>
</html>