Source Viewer : /control/menu-demo.htm
In Click, an application menu can be defined in the configuration file
<a href="$context/source-viewer.htm?filename=WEB-INF/menu.xml">/WEB-INF/menu.xml</a>.
<p/>
This JavaScript drop down menu can be rendered by referencing the root Menu in
the Page template.
<pre class="codeHtml">
$rootMenu </pre>
The menu can also be rendered using a Velocity Macro, such as the
<tt>writeMenu()</tt> macro defined in
<a href="$context/source-viewer.htm?filename=macro.vm">macro.vm</a>.
<pre class="codeHtml">
#writeMenu($rootMenu) </pre>
The example menu pages all extend <tt>BorderPage</tt> which defines a <span class="st">"rootMenu"</span>
control.
<pre class="codeJava">
<span class="kw">public class</span> MenuPage <span class="kw">extends</span> BorderedPage {
@Bindable <span class="kw">protected</span> Menu rootMenu = new MenuFactory().getRootMenu();
}</pre>