VerticalMenu demo

This page displays a verticalmenu component.
The defaultActiveItem parameter must be set to select the default menu item.

Notice that the content of verticalMenuItem can be :
  • A Tapestry component
  • A list of li elements
  • Or any HTML content...
Notice that the event triggered by verticalmenu component can be handle to achieve the page navigation.

In Action
This is the second menu item
with long HTML content

TML Source code

	<div style="width: 200px;">		
	<ex:verticalMenu t:id="verticalmenu" defaultActiveItem="example1">
		<ex:verticalMenuItem t:id="example1" t:title="literal:Example 1">
  				<li><t:pagelink page="components/verticalMenu/Example1">Example 1</t:pagelink></li>
  				<li><t:pagelink page="index">Back to index</t:pagelink></li>
		<ex:verticalMenuItem t:id="item2" t:title="literal:Item 2">
  			This is the second menu item
  			<br /> with long HTML content
  		<ex:verticalMenuItem t:id="external" 
  		                     t:target="_blank" />

Java code

    	private PageRenderLinkSource pageLinkSource;

    	private VerticalMenu verticalMenu;

    	Object handleSelectMenu(String menuId)
        	if ("external".equals(menuId))
	        		URL external = null;
	        		external = new URL("");
	        	catch (MalformedURLException ex)
	        		throw new RuntimeException(ex);
	        	return external;
        	if ("example1".equals(menuId)) 
        		return pageLinkSource.createPageRenderLink(Example1.class); 
        	return this;