alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Struts example source code file (treeExampleStatic.jsp)

This example Struts source code file (treeExampleStatic.jsp) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Struts tags/keywords

end, example, example, javascript, javascript, please, snippet, snippet, start, static, tag, tree, tree, ui

The Struts treeExampleStatic.jsp source code

<%@taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<title>Showcase - UI Tag Example - Tree Example (Static)
<sx:head/>
</head>
<body>

<!-- START SNIPPET: treeExampleStaticJsp -->

<script language="JavaScript" type="text/javascript">
    dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
        dojo.io.bind({
            url: "<s:url value='/tags/ui/ajax/staticTreeSelectAction.action'/>?nodeId="+node.node.title,
            load: function(type, data, evt) {
                var divDisplay = dojo.byId("displayIt");
                divDisplay.innerHTML=data;
            },
            mimeType: "text/html"
        });
    });
</script>


<div style="float:left; margin-right: 50px;">
<sx:tree label="parent"  templateCssPath="/struts/tree.css" 
showRootGrid="true" showGrid="true" treeSelectedTopic="treeSelected">
    <sx:treenode label="child1" >
        <sx:treenode label="grandchild1" id="grandchild1Id"/>
        <sx:treenode label="grandchild2" id="grandchild2Id"/>
        <sx:treenode label="grandchild3" id="grandchild3Id"/>
    </sx:treenode>
    <sx:treenode label="child2" id="child2Id"/>
    <sx:treenode label="child3" id="child3Id"/>
    <sx:treenode label="child4" id="child4Id"/>
    <sx:treenode label="child5" id="child5Id">
        <sx:treenode label="gChild1" id="gChild1Id"/>
        <sx:treenode label="gChild2" id="gChild2Id"/>
    </sx:treenode>
</sx:tree>
</div>


<div id="displayIt">
Please click on any node on the tree.
</div>

<!-- END SNIPPET: treeExampleStaticJsp  -->

</body>
</html>

Other Struts examples (source code examples)

Here is a short list of links related to this Struts treeExampleStatic.jsp source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.