|Re: Binding own structure to TreeTable [message #584454 is a reply to message #584435]
||Thu, 07 January 2010 12:25
| Christian Campo
Registered: July 2009
Am 04.01.10 10:17, schrieb matthias:|
> Hi there,
> i'm new to Riena, i did the first steps using the tutorials and really
> liked it so far. At the moment i'm trying to build a treetable that
> contains my own model structure (an hierarchy with 5-6 levels). I want
> to bind the data to the view, so that changes are updated to the model
> simultaneously. The "bindToModel()" method needs a certain
> treeElementClass, but i have a whole structure of classes to bind.
> It works when i implement ITreeNode to each class of my structure and
> use ITreeNode.class in the bindToModel() method. But i don't like this
> approach since at the moment when i set up the structure i don't care if
> it's getting displayed or not. Is there a better approach for that,
> maybe using special content providers? Are the examples somewhere?
> thanks, matthias
There are two ways I can see what you can do. Actually the bindToModel implementation does not require a ITreeNode in
its parameter list, it takes any object together with a list of properties for getting to the child node, the parent and
evaluating the visibilty etc. If you have this methods already in your own structure you could use just that.
tree.bindToModel(treeRoot, MyStruct.class,"childred","parent","value",null,null) // the last two were enablement and
visibilty accessors that should work and create the desire effect shouldnt it ?
The second approach would be to create a TreeNode instance that wraps your own structure. You would then pass the
treeNode instance to bindToModel and subclass TreeNode to translate the methods into access to your own structure.
But I think the first approach should work for you much more better......
Powered by FUDForum
. Page generated in 0.02434 seconds