Hi,
I've been able to successfully use the tacos tree component for the most part,
to implement a tree design for our application. However, I am running into the
issue of not being able to conditionally select the class (style) to use for
displaying the node label.
The implementation is very similar to the tacos file tree demo. However, the
condition "node==selectedNode" always evaluates to false. I have also tried
the "node.equals(selectedNode)", but that doesn't work either. Any pointers,
suggestions would be greatly appreciated.
Thanks!
-Anitha.
Code snippets are as follows.
.page
-----
<property-specification name="node" type="<package>.TreeNode"/>
<property-specification name="selectedNode" type=<packae>.TreeNode"
persistent="yes"/>
<component id="nodeLabel" type="Insert">
<binding name="value" expression="node.name"/>
<binding name="class"
expression="node==selectedNode ? 'selected' : 'notSelected'"/>
</component>
.html
-----
<div id="tree" jwcid="campaignTree"><a jwcid="nodeLink"><img jwcid="icon"
align="absbottom"/><span jwcid="nodeLabel"/></a>
</div>
.java - Page class
-----
public abstract TreeNode getSelectedNode();
public abstract void setSelectedNode(TreeNode node);
public void select(IRequestCycle cycle)
{
Object[] parameters = cycle.getServiceParameters();
String name = (String) parameters[0];
String id = (String) parameters[1];
TreeNode node = new TreeNode(name, id);
setSelectedNode(node);
}
.css
----
#tree {
background-color:#FFFFFF;
position: absolute;
top: 140px;
bottom: 0;
left: 50px;
width: 500px;
overflow: auto;
height: 350px;
border:solid;
margin-left: 2px;
margin-bottom: 1em;
}
#tree a {
text-decoration: none;
}
#tree a:hover {
background-color: #aaaaaa;
}
#tree .selected {
font-weight:bold;
color:#0000CC;
font-size:90%;
text-decoration: underline;
}
#tree .notSelected {
font-weight:normal;
color:#000000;
font-size:90%;
text-decoration: none;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]