<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- We need a doctype to allow us to use special characters like
We use a "strict" DTD to make IE follow the alignment rules. -->
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<head>
<link rel="stylesheet" type="text/css" href="${context:css/examples/examples.css}"/>
<style type="text/css">
.eg th { text-align: right; padding-right: 14px; font-weight: normal; }
.eg .buttons { margin-top: 12px; }
DIV#alerts { margin: auto; width: 500px; }
<t:if test="hideDismiss">
DIV.t-alert-controls { display: none; }
</t:if>
</style>
</head>
<body>
<h1>Alerts</h1>
Here we demonstrate Tapestry's Alerts component.<br/>
You can tailor the appearance of the alerts to suit your needs by overriding CSS classes t-alert-container, t-info, t-warn, t-error, etc.<br/>
<div class="eg">
<form t:type="Form">
<table>
<tr>
<th>
<t:label for="duration"/>:
</th>
<td>
<t:RadioGroup t:id="duration" value="duration" validate="required">
<t:Radio t:id="durationS" value="Duration.SINGLE" label="Single"/><t:label for="durationS"/>
<t:Radio t:id="durationT" value="Duration.TRANSIENT" label="Transient (15 seconds)"/><t:label for="durationT"/>
<t:Radio t:id="durationU" value="Duration.UNTIL_DISMISSED" label="Until Dismissed"/><t:label for="durationU"/>
</t:RadioGroup><br/>
</td>
</tr>
<tr>
<th>
<t:label for="severity"/>:
</th>
<td>
<t:RadioGroup t:id="severity" validate="required">
<t:Radio t:id="severityI" value="Severity.INFO" label="Info"/><t:label for="severityI"/>
<t:Radio t:id="severityW" value="Severity.WARN" label="Warn"/><t:label for="severityW"/>
<t:Radio t:id="severityE" value="Severity.ERROR" label="Error"/><t:label for="severityE"/>
</t:RadioGroup><br/>
</td>
</tr>
<tr>
<th>
<t:label for="quantity"/>:
</th>
<td>
<t:RadioGroup t:id="quantity" validate="required">
<t:Radio t:id="quantity1" value="literal:1" label="1"/><t:label for="quantity1"/>
<t:Radio t:id="quantity2" value="literal:2" label="2"/><t:label for="quantity2"/>
<t:Radio t:id="quantity3" value="literal:3" label="3"/><t:label for="quantity3"/>
</t:RadioGroup><br/>
</td>
</tr>
<tr>
<th>
<t:label for="showDismiss"/>:
</th>
<td>
<t:RadioGroup t:id="showDismiss" validate="required">
<t:Radio t:id="showDismissY" value="literal:true" label="Yes"/><t:label for="showDismissY"/>
<t:Radio t:id="showDismissN" value="literal:false" label="No"/><t:label for="showDismissN"/>
</t:RadioGroup><br/>
</td>
</tr>
</table>
<div class="buttons">
<input type="submit" value="Submit"/>
</div>
</form>
<t:alerts/>
</div>
References:
<a href="http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/corelib/components/Alerts.html">Alerts</a>,
<a href="http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/alerts/AlertManager.html">AlertManager</a>,
<a href="http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/alerts/Duration.html">Duration</a>,
<a href="http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/alerts/Severity.html">Severity</a>,
<a href="http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">@Inject</a>.<br/><br/>
<a t:type="pagelink" t:page="Index" href="#">Home</a><br/><br/>
<t:sourcecodedisplay src="/web/src/main/java/jumpstart/web/pages/examples/component/Alerts.tml"/>
<t:sourcecodedisplay src="/web/src/main/java/jumpstart/web/pages/examples/component/Alerts.java"/>
<t:sourcecodedisplay src="/web/src/main/java/jumpstart/web/css/examples/examples.css"/>
</body>
</html>