blob: a287c285cb1873dc06bb5572dd73e78d9b1e3c52 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ -->
<html>
<head>
<title>Insert</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="ImageSubmit.html"><IMG alt=ImageSubmit 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="InsertText.html"><IMG alt=InsertText 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>Insert</b></font></td>
</tr>
<tr>
<td>
<A href="../api/org/apache/tapestry/components/Insert.html">
org.apache.tapestry.components.Insert</a>
</td>
</tr>
</table>
</td>
<td>
<table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8">
<tr>
<td>Inserted text</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td colspan="2">
<b>Description</b>
<br>
Allows
for the insertion of text (with a specified format) into the HTML.
The text itself can be 'transformed' or not (where 'transform' in
this case means that various characters like &lt; and &gt; are
transformed into HTML safe representations such as &amp;lt; and
&amp;gt;). The
value for the text is bound, just like any other component.
</td>
</tr>
<tr>
<td colspan="2">
<b>See Also</b>
<br>
<A href="Conditional.html">Conditional</a>,
<A href="Foreach.html">Foreach</a>,
<a href="RenderBlock.html">RenderBlock</a>,
<A href="InsertText.html">InsertText</a>,
<a href="RenderBody.html">RenderBody</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>value</td>
<td>Object</td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>The value to be inserted. If the binding is null, then nothing is
inserted. Any object may be inserted, the <tt>toString()</tt> method is
used to convert it to a printable value.
</td>
</tr>
<tr>
<td>format</td>
<td>
<a href="http://java.sun.com/products/jdk/1.2/docs/api/java/text/Format.html">
<tt>Format</tt>
</a>
</td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>An optional format object used to convert the value parameter for
insertion into the HTML response.
</td>
</tr>
<tr>
<td>class</td>
<td>String</td>
<td>in</td>
<td>no</td>
<td>&nbsp;</td>
<td>If specified, then the output is wrapped in an HTML &lt;span&gt; tag,
using the value specified as the CSS class.
<p>
Informal parameters are only rendered if a class is specified.
</p>
</td>
</tr>
<tr>
<td>raw</td>
<td>boolean</td>
<td>in</td>
<td>no</td>
<td>false</td>
<td>If true, then the method
<A href="../api/org/apache/tapestry/IMarkupWriter.html#printRaw(java.lang.String)">
<tt>IMarkupWriter.printRaw(String)</tt></a> is used, rather than
<A href="../api/org/apache/tapestry/IMarkupWriter.html#print(java.lang.String)">
<tt>IMarkupWriter.print(String)</tt></a>.
<p>This bypasses the normal safeguards
and is used when the value to insert contains HTML markup that
should be emitted as is.</p>
</td>
</tr>
</table>
<P>Body: <STRONG>removed</STRONG><BR>Informal parameters:
<STRONG>allowed</STRONG>
<br>
Reserved
parameters: <EM>none</EM> </P>
</td>
</tr>
<tr>
<td colspan="2">
<b>Examples</b>
<p>
Inserts the pages dueDate and applies the specified DateFormat and HTML class.
<p>
<table class="examples" cellpadding="8">
<tr>
<td>
The order was due on the <font color="red"><b>21 January 2002</b></font>.
</td>
</tr>
</table>
<pre>
The order was due on the &lt;span jwcid="<span class="jwcid">@<a href="Insert.html">Insert</a></span>" value="ognl:dueDate" format="ognl:@EnquiryPage.@DATE_FORMAT" class=&quot;ognl:dueClass&quot;/&gt;.
&lt;property-specification name=&quot;dueDate&quot; type=&quot;java.util.Date&quot;/&gt;<br>&lt;property-specification name=&quot;dueClass&quot; type=&quot;java.lang.String&quot;/&gt;<br>
public abstract class EnquiryPage extends BasePage {
public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd MMM yyyy");
public abstract Date getDueDate();
public abstract String getDueClass();
}
</pre>
</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td colspan="2">
<table width="100%">
<tr>
<td align="left">
<A href="ImageSubmit.html"><IMG alt=InsertImage src="common-images/prev.png"></a>
</td>
<td align="middle">
<A href="index.html"><IMG alt=Home src="common-images/home.png"></a>
</td>
<td align="right">
<A href="InsertText.html"><IMG alt=InsertText src="common-images/next.png"></a>
</td>
<tr></tr>
</table>
</td>
</tr>
</table></tr></table>
</body>
</html>