blob: b3c35137dd84f44fcefa410e6cc0315c54b4830f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id$ -->
<html>
<head>
<title>Image</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="Hidden.html"><IMG alt=Hidden 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="ImageSubmit.html"><IMG alt=ImageSubmit 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>Image</b></font></td>
</tr>
<tr>
<td>
<A href="../api/org/apache/tapestry/html/Image.html">
org.apache.tapestry.html.Image</a>
</td>
</tr>
</table>
</td>
<td>
<table align="right" valign="middle" cellpadding="8">
<tr>
<td><IMG alt="Image Component" src="images/poweredby.png" ></td>
</tr>
</table>
</td>
</tr>
<tr valign="center">
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<b>Description</b>
<br>
Used to insert an image. <A href="Rollover.html">Rollover</a> is
a similar component that can create dynamic mouse-over effects as well.
</td>
</tr>
<tr>
<td colspan="2">
<b>See Also</b>
<br>
<A href="ImageSubmit.html">ImageSubmit</a>,
<A href="Rollover.html">Rollover</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>image</td>
<td><A href="../api/org/apache/tapestry/IAsset.html"><tt>IAsset</tt></a></td>
<td>in</td>
<td>yes</td>
<td>&nbsp;</td>
<td>The image to show.</td>
</tr>
<tr>
<td>border</td>
<td>int</td>
<td>in</td>
<td>no</td>
<td>0</td>
<td>Corresponds to the HTML "border" attribute.</td>
</tr>
</table><BR>Body:
<STRONG>removed</STRONG><BR>Informal parameters:
<STRONG>allowed</STRONG>
<br>
Reserved parameters: "src"
</td>
</tr>
<tr>
<td colspan="2">
<b>Examples</b>
<p>
Inserts the static context path based image. This example uses a
&lt;context-asset&gt; to reference the image.
<p>
<table class="examples" cellpadding="8" valign="middle">
<tr>
<td>
<a href="http://tapestry.sourceforge.net/">
<IMG alt="View Tapestry Home" src="images/poweredby.png" >
</a>
</td>
<td>
<font color="navy" size="+2"><b><i>Powered by Tapestry</i></b></font>
</td>
</tr>
</table>
<pre>
&lt;table cellpadding="8" valign="middle"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://tapestry.sourceforge.net/"&gt;
&lt;img jwcid="<span class="jwcid">@<a href="Image.html">Image</a></span>" image="ognl:assets.imageAsset" alt="View Tapestry Home"/&gt;
&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;font color="navy" size="+2"&gt;&lt;b&gt;&lt;i&gt;Powered by Tapestry&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;context-asset name="imageAsset" path="/images/poweredby.png"/&gt;
</pre>
<hr>
<p>
Inserts the dynamic image obtained from the page's <tt>NewsItem</tt> property.
This example uses the <A href="../api/org/apache/tapestry/asset/ExternalAsset.html">
<tt>ExternalAsset</tt></a> to reference the image's URL.
<p>
<table class="examples" cellpadding="8">
<tr>
<td>
<h4>Elvis helitanker Saves 14 Lives</h4>
Elvis (Erickson S-64F ) super helitanker used to fight Sydney Australia
Christmas bushfires. Credited with saving hundreds of homes and
14 firefighters lives in the Black Christmas crisis. Photo of Elvis
helicoper on loan from US refueling at Glenbrook RAAF base.
<p>
Date : 4 January 2002</p>
</td>
<td>
<IMG alt="Elvis super helitanker save 14 firefighters lives" src="images/elvis.jpg" >
</td>
</tr>
</table>
<pre>
&lt;table cellpadding="8"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4&gt;&lt;span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:newsItem.title"/&gt;&lt;/h4&gt;
&lt;span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:newsItem.body"/&gt;
&lt;p&gt;
Date : &lt;span jwcid="@<a href="Insert.html">Insert</a>" value="ognl:newsItem.date" format="ognl:@NewsItemPage@DATE_FORMAT"/&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;img jwcid="<span class="jwcid">@<a href="Image.html">Image</a></span>" image="ognl:newsItem.imageAsset" alt="ognl:newsItem.summary"/&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;property-specification name=&quot;orderItem&quot; type=&quot;com.dsconsulting.cms.model.NewsItem&quot;/&gt;<br>
public abstract class NewsItemPage extends BasePage {
public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd MMM yyyy");
public abstract NewsItem getNewsItem();
}
public class NewsItem implements Serializable {
private String title;
private String body;
private String summary;
private Date date;
private String imageURL;
public NewsItem(String title, String summary, String body, Date date,
String imageURL) {
this.title = title;
this.body = body;
this.summary = summary;
this.date = date;
this.imageURL = imageURL;
}
public String getTitle() { return title; }
public String getBody() { return body; }
public String getSummary() { return summary; }
public String getDate() { return date; }
public IAsset getImageAsset() { return new <A href="../api/org/apache/tapestry/asset/ExternalAsset.html"><tt>ExternalAsset</tt></a>(imageURL, null); }
}
</pre>
</td>
</tr></table>
</td></tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td align="left"><A href="Hidden.html"><IMG alt=Hidden 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="ImageSubmit.html"><IMG alt=ImageSubmit src="common-images/next.png"></a></td>
</tr>
</table>
</body>
</html>