pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Volkert <tvolk...@gmail.com>
Subject Re: TreeViewListener question
Date Sun, 07 Mar 2010 14:00:46 GMT
Hi David,

I'm currently away on vacation but will be back tomorrow and will look at
this then (easier to type on a computer than a phone).

Cheers
-T

On Mar 5, 2010 9:13 AM, "David McNelis" <Dmcnelis@sharedmarketing.com>
wrote:

 Morning,



With the TreeViewListener, I’m not seeing an event triggered with my first
selection in my multi-select tree.  Here is an example of my implementation:

treeview.setTreeData(etNodes);

treeview.setSelectMode(TreeView.SelectMode.*MULTI*);



treeview.getTreeViewSelectionListeners().add(*new*TreeViewSelectionListener(){



@Override

*public* *void* selectedPathAdded(TreeView arg0, Path arg1) {

ExtendedTreeNode etNode = (ExtendedTreeNode)Tree.*get*(treeview.getTreeData(),
arg1);

System.*out*.println(etNode.getValue());

}

@Override

*public* *void* selectedPathRemoved(TreeView arg0, Path arg1) {



}

@Override

*public* *void* selectedPathsChanged(TreeView arg0, Sequence<Path> paths) {

etNode = *new* java.util.ArrayList<BigDecimal>();

*for*(*int* i=0, n=paths.getLength(); i < n; i++){



ExtendedTreeNode etNode = (ExtendedTreeNode)Tree.*get*(treeview.getTreeData(),
paths.get(i));

System.*out*.println(etNode.getValue());

}

}

});



The first click produces no output or errors.  If I click the same element a
second time, then the etNode.getValue() produces the expected result.  I
looked at the other treeview based listener classes and didn’t see anything
that I thought I should be implementing as well.  If its as simple as that,
what class should I be looking toward?

Mime
View raw message