-
1. Re: Tree with DnD support
trouby Apr 5, 2007 2:24 PM (in response to trouby)This was my mistake as I had the tree / dropSupport in different forms,
Yet still, I see weird different values set in 'event.getDragValue()', I can't figure out how to control its values,
Setting the 'dragValue' parameter in the treeNode tag does not affect its value at all,
Thanks. -
2. Re: Tree with DnD support
nbelaevski Apr 5, 2007 3:58 PM (in response to trouby)Hello!
getDragValue() method return data object for the TreeNode being dragged. It shouldn't be allowed to be set at JSP page. I've filed issue in JIRA on that: http://jira.jboss.com/jira/browse/RF-77 -
3. Re: Tree with DnD support
trouby Apr 5, 2007 4:20 PM (in response to trouby)Hey,
Alright regarding the TLD,
getDragValue() method returns 'org.richfaces.component.ListRowKey' object type, with a value of 'x:y' where x=the ID of the parent of the selected treeNode and y=the ID of the selected treeNode,
That doesnt look like the treeNode object of the selected node,
Is that the normal behaviour?
Asaf. -
4. Re: Tree with DnD support
nbelaevski Apr 6, 2007 10:08 AM (in response to trouby)Hello!
Please excuse me for pointing wrong. Legal drag/drop values should be of TreeRowKey type to allow developer to obtain either node data or node references. I've changed code in trunk to comply.
Here is the code snippet to obtain data:... Object rowKey = tree.getRowKey(); try { tree.setRowKey(event.getDragValue()); Object data = tree.getRowData(); TreeNode node = tree.getTreeNode(); ... //use it } finally { tree.setRowKey(rowKey); }
Note that there were no getTreeNode() method accessible in 3.0.0 release. It is accessible at trunk versions. -
5. Re: Tree with DnD support
trouby Apr 6, 2007 10:53 AM (in response to trouby)That makes more sense,
How do I download the version from SVN?
Is there any auto archive and away to download a binary version from trunk? or any instructions on how to download the sources / compile&pack them?
thanks. -
6. Re: Tree with DnD support
sergeysmirnov Apr 6, 2007 3:36 PM (in response to trouby)RichFaces Snapshots (nightly builds): http://maven.exadel.com/org/richfaces/richfaces/3.0.1-SNAPSHOT/
Ajax4jsf Snapshots (nightly builds): http://maven.exadel.com/org/ajax4jsf/ajax4jsf/1.1.1-SNAPSHOT/ -
7. Re: Tree with DnD support
nbelaevski Apr 8, 2007 10:57 AM (in response to trouby)Hello!
I've added a couple of shortcut methods to UITree class to get row data and tree node by key:UITree#getRowData(Object)
andUITree#getTreeNode(Object)
You need to just pass row key as argument and get back data or node -
8. Re: Tree with DnD support
trouby Apr 8, 2007 12:27 PM (in response to trouby)Hey,
Are there any samples? better documentation? probably I'm missing something...
I followed your directions, I always get 'null's all way long,
All samples shows TreeNodes that implements the 'TreeNode' interface and thats it.
Then I browsed the code, and extended by TreeNodes by the 'TreeDataNode' class.
Anyway, my 'rootTreeNode.setRowKey(event.getDragValue());' / getRowData returns null.
Probably I'm missing something, so a sample / more documentation would be good...
Thanks,
Asaf. -
9. Re: Tree with DnD support
nbelaevski Apr 8, 2007 12:46 PM (in response to trouby)getRowData() methods invokes getData() method of the TreeNode interface. Does it return something in your implementation?
-
10. Re: Tree with DnD support
trouby Apr 8, 2007 1:12 PM (in response to trouby)In my implementation, as in samples, I return the treeNode itself in each of my TreeNodes,
And of course when the tree gets builds it invokes getData(),
But 'getRowData()' returns null.
If the state of the tree is important, I keep the tree in the session, and invoke getRowData() over the root treeNode,
Is that the correct way?
Asaf. -
11. Re: Tree with DnD support
nbelaevski Apr 8, 2007 3:42 PM (in response to trouby)I've added diagnostic output to our tree-demo sample. You can see how it's built... The code resides here:http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/tree-demo/
-
12. Re: Tree with DnD support
trouby Apr 11, 2007 9:44 AM (in response to trouby)Hey,
Yeah, works perfectly, including the new features of UITree,
BTW, at the moment I upgraded to the latest richfaces snapshot Tree's AJAX switchType stopped working (server/client works ok)
I also tried to upgrade to the newest Ajax4JSF, but it still does not work,
Thanks,
Asaf.