How to shrink the tree item when clicking on Parent item

Hi all,

         In my vaadin application , i used tree view. If i clicked the [b]

parent item of tree
[/b] or its
icon
, it exapnds and shows its children properly .I used the method

tree.exapndItem(itemid)
. But when i clicking again
on parent item
it wouldn’t shrink. It would shrink Only if i clicked on the
icon
of the parent item.
How to solve this proplem ?

Please give some solution.

Thank you

Regards

RAJESH THANGA