Magazine
 
Struts 2 Non-form Tags (UItags)

tab).

To use tabbedPanel tag, the head tag must be included on the jsp page and must be configured for performance or debugging purposes. However, If you want to use the
cookie feature then you must provide a unique id for the tabbedpanel component. This is used for identifying the name of component that is stored by the cookie.

Add the following code snippet into the struts.xml file.

struts.xml

<action name=”tabbedPanel”>
<result>/pages/nonformTags/
tabbedpanel.jsp</result>
</action>

Create a jsp using the tag <s:tabbedPanel>. This tag is used for creating the tabs

tabbedpanel.jsp

<%@ taglib prefix=”s” uri=”/struts-tags” %>
<html>
<head>
<s:head theme=”ajax” debug=”true”/>
</head>
<body>
<table border=”1" width=”30%”>
<tr>
<td width=”100%”>
<s:tabbedPanel id=”test” >
<s:div id=”one” label=”Tab 1"
theme=”ajax” labelposition=”top” >
First Panel.<br>
Tabbed Panel Example<br>
JavaJazzUp
</s:div>
<s:div id=”two” label=”Tab 2"
theme=”ajax”>
Second Panel.<br>
JavaJazzUp
</s:div>

 

<s:div id=”three” label=”Tab 3"
theme=”ajax”>
Third Panel.<br>
JavaJazzUp
</s:div>
</s:tabbedPanel>
</td>
</tr>
</table>
</body>
</html>

Output:

When you run the above example, you get the output as:

5. tree and treenode (Ajax Tag) tags Example

In this section, you will learn about the tree and treenode tags. These both work with the Ajax support.

tree: This is a tree widget with AJAX support. Normally this tag uses the “id” attribute. The “id” attribute is required if the “selectedNotifyTopic” or the “href” attribute is going to be used.

treenode: This is a tree node which renders a tree node within a tree widget with AJAX support. The following of the two combinations are used depending on the requirement like the tree is needed to be constructed dynamically

Mar 2008 | Java Jazz Up |34
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59,

Download PDF