TreeTable in core with weird behaviour

Hi,

I am having trouble using the core TreeTable of Vaadin 6.7. When I use the addon version 1.2.2 everything (except the item click listener problem on the expand/collapse arrow) is working fine.
The root nodes are all rendered correctly but when trying to expand a node (I add child nodes dynamically), they are misplaced or sometimes only visualized when I click multiple times on the expand/collapse arrow.

I can’t wrap my head around it because the only thing I’m doing different with the TreeTable core version is using the Tree.ExpandListener which is not present in the addon version… the events are fired fine, just the tree rendering seems to be broken.

Has anyone experienced something similar?

hi,

I have faced the similar problems with core TreeTable. I have used combination of (addon)Treetable and HierarchicalContainer without problems, but after taking core TreeTable in to use I faced those misplaced or badly rendered nodes.

I have tried using “old way” : HierarchicalContainer that implements Collapsible and modifies data model dynamically in setCollapsed() method and by using new Expand/Collapse listeners to detect user events and then update model… and in both ways result was same: malfunctioning tree (especially when trying to remove nodes from model by using HierarchicalContainer .removeItemRecursively() )

Hi guys,

The rendering of expanding/collapsing rows in TreeTable has undergone a pretty big refactoring to enable repainting of only the expanded/collapsed rows. The old way was to repaint all rows in the table on a single expand/collapse. Your troubles are probably due to some bug that slipped past me while implementing this. Could you please
open a ticket
and attach a small application showing the issues and I’ll take a look at it ASAP. Thanks.

/Jonatan

Hi,

I made ticket
#7780

We are having the same problem, except we are not using those listeners. Instead we do this in the TreeTable directly:


public void setAllCollapsed(boolean isCollapsed){
              for(Object item : getItemIds()) {
			if(item instanceof Parent) {
				setCollapsed(item, isCollapsed);
			} else {
				setCollapsed(((Child)item).getParent(), isCollapsed);
			}
		}
}	

Let us know when this is fixed =)

i have gone through the ticket its been moved to fixed … but the issue still exist when i try to add the children dynamically using expand listener… is there any workaround or add-on avaliable ? please let me know

below is the expand listener

public void nodeExpand(ExpandEvent event) {

	Object item = treetable.addItem(
            new Object[] { "Year 2010", 18, cal.getTime() }, null);
     treetable.setChildrenAllowed(item, false);
    treetable.setParent(item, event.getItemId());
    
}

I’m having similar problems with the TreeTable. When dynamically removing and adding nodes and then expanding or collapsing them, rendering issues arise. They are usually cleared by refreshing the browser window but it’s still an annoyance.

I’m using Vaadin 6.7.2

hi sorry guys its working fine in 6.7.2 excellent … i was working on 6.7.0 so it didnt work.

Which container are you using for the TreeTable?

The latest nightly build contains at least one fix for cases where the underlying container does not implement ItemSetChangeNotifier - a problematic case in general, and one that was causing internal errors with TreeTable in some cases.

I’m using my own implementation of Hierarchical based on the AbstractInMemoryContainer. I’ve even tried to use the Vaadin’s HierarchicalContainer to see if there are any differrences regarding the issue but the issues persist. I will try the latest nightly build as You suggest and report here, thanks!

Hello fellow Vault Dweller.

Seems like you’ve hit the same bug I did a few weeks back. Namely this one:
http://dev.vaadin.com/ticket/7785

This looks
exactly
like what I’m experiencing!

I would just add that this behavior occurs even on a fresh container. It seems that just setting the data source and then collapsing/expanding the items programmatically in the same server round-trip causes the trouble. Can I help somehow to get the issue upvoted? Thanks!

Put yourself as CC on that ticket. Having a few CC:s usually shows that a lot of people wants it and might get the cogs rolling.