Vaadin Treetable

Hi,

I am newbie to Vaadin and GWT.

I am trying to use the TreeTable component in an hibernate / spring application which deals with Task and sub-Task.

I have tested the WorkLog example for treetable component and have slightly modified it to suit my needs.
1>. Instead of WorkRecord and CompositeRecord I have one class called Task which has a collection of Tasks (children) and a groupItem ( for parent).

now when i load the whole Tree the nodes of the tree are created with children , but the children is not visible in the view…



Any idea what could be the problem.??

Thanks and Kind Regards,
Echo

To help further :-

The Task.java class

package somepackage;

public class Task implements Serializable {

private Collection<Task> children = new ArrayList<Task>();

private Task groupItem; // the parent task

public Collection<Task> getChildren() {
    return children;
}

 public void setChildren(Collection<Task> children) {

	 this.children = children;
}
 
 public Task getGroupItem() {
        return groupItem;
 }

 public void setGroupItem(Task groupItem) {
	 
	 if (this.groupItem != null) {
            this.groupItem.getChildren().remove(this);
        }
        this.groupItem = groupItem;
        groupItem.getChildren().add(this);
  }

}

========================================================================

The application which adds the tree items

    public static TaskContainer loadData() {
    	TaskContainer taskContainer = new TaskContainer();
    	
    	Task newTask;
    	
    	
    	List <Task> taskList = tasksBo.getRootTaskList();
    	Iterator<Task> itr = taskList.iterator(); 

    	while(itr.hasNext()) {
    		Task taskitem = itr.next();
    		
    		taskContainer.addBean(loadTaskInfo(taskitem));
	    }	
    	return taskContainer;
 }

    public static Task loadTaskInfo(Task taskItem)
    {
    	Task newTaskItem = new Task();
    	
    	newTaskItem.setTaskId(taskItem.getTaskId());
    	newTaskItem.setTaskDesc(taskItem.getTaskDesc());
    	newTaskItem.setParentId(taskItem.getParentId());
    	newTaskItem.setComments(taskItem.getComments());
    	newTaskItem.setTaskDesc(taskItem.getTaskDesc());
    	newTaskItem.setStartDate(taskItem.getStartDate());
    	newTaskItem.setEndDate(taskItem.getEndDate());
    	
    	try
    	{
    		List<Task> children = tasksBo.getChildren(taskItem.getTaskId());
	    	Iterator<Task> itr = children.iterator(); 

    		while(itr.hasNext()) {
    			Task taskitem = itr.next();
	    		Task childTask = loadTaskInfo(taskitem);

    			// TODO : Add the parent child relationship
    			childTask.setGroupItem(newTaskItem);

	    		// TODO : Add the child parent relationship
    			newTaskItem.addChild(childTask);
	    		
    		}
    		
    	}
    	catch (Exception e)
    	{
    	}
    	
    	return newTaskItem;
    }

}

[font=Verdana]
I realized that i was not calling addBean for each of the child nodes.

But now when i call addBean, each of the child nodes appear twice…infact if a child node is 3 level down, it appears thrice.
Apparently i have not understoond the BeanItemContainer and ContainerHierarchical concept at all

could Somebody please help me.

i can upload the source code if required.
[/font]