Source Viewer : /control/email-form.htm
<style type="text/css">
td.fields { margin-top: 1em; line-height: 2; }
</style>
$form
<p> </p>
The form demonstrates a custom
<a href="$context/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/control/RichTextArea.java">RichTextArea</a>
control using the
<a target="blank" href="http://developer.yahoo.com/yui/editor/">YUI editor</a>.
The control overrides the Field method <tt>getHeadElements()</tt> to include its
JavaScript imports automatically:
<pre class="codeJava">
<span class="kw">public</span> List getHeadElements() {
if (headElements == <span class="kw">null</span>) {
headElements = <span class="kw">super</span>.getHeadElements();
headElements.add(<span class="kw">new</span> CssImport(<span class="st">"/yui/fonts/fonts-min.css"</span>));
headElements.add(<span class="kw">new</span> CssImport(<span class="st">"/yui/editor/skins/sam/simpleeditor.css"</span>));
headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/yahoo-dom-event/yahoo-dom-event.js"</span>));
headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/element/element-beta-min.js"</span>));
headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/container/container_core-min.js"</span>));
headElements.add(<span class="kw">new</span> JsImport(<span class="st">"/yui/editor/simpleeditor-min.js"</span>));
}
...
<span class="kw">return</span> headElements;
} </pre>