no...you can check a node with setChecked but before is renderer and calling
it at construction.
but i'm not sure of it.
try this
TreeNode node = new TreeNode("checked_node") {
  {
    setChecked(true);
  }
}

I have seen sometimes that this way is different than

TreeNode node = new TreeNode("checked_node");
node.setChecked(true);

In the sense that first function the second not!
(i saw with setExpanded)...
infact if you look at createNode of xmltreeloader
you'll see that every setter is called as in the first code.

bye Pat

2009/7/9 Roundcrisis <[email protected]>

> Hi Kornel
> Thanks for the pointer,
> however  not sure I follow. you cant check or uncheck a node that is not
> rendered, right?
> so i would imagine this cant happen...
> Cheers
>
>
> Andrea
>
>
>
>
> On Thu, Jul 9, 2009 at 12:45 PM, Kornel Csaszar <[email protected]> wrote:
>
>> Andrea,
>> It's good to be careful with getting info back from widgets like that. If
>> the widget
>> is not yet rendered you will get a very nasty general error (yellow
>> triangle).
>>
>> If you need that info and you are not certain the component
>> will have been rendered by that time, it's often best to keep collections
>> of
>> objects on your own of the tree node references.
>>
>> -kornel
>>
>>
>> On Mon, Jul 6, 2009 at 10:30 AM, Roundcrisis <[email protected]>wrote:
>>
>>> Yeah that does work thanks :D
>>> Andrea
>>>
>>>
>>>
>>>
>>> On Mon, Jul 6, 2009 at 12:57 PM, Patrizio De Michele <
>>> [email protected]> wrote:
>>>
>>>> hi,
>>>> maybe you can use this code, try it and make me know:
>>>>
>>>> final List<Node> checkedNodes = new ArrayList<Node>();
>>>> final List<Node> allNodes = new ArrayList<Node>();
>>>>         treePanel.getRootNode().cascade(new NodeTraversalCallback() {
>>>>             public boolean execute(Node node) {
>>>>                 if (Boolean.valueOf(node.getAttribute("checked"))) {
>>>>                     checkedNodes.add(node);
>>>>                 }
>>>>                 allNodes.add(node);
>>>>                 return true;
>>>>             }
>>>>         });
>>>>
>>>> bye Patrizio
>>>>
>>>>
>>>> 2009/7/6 Andrea <[email protected]>
>>>>
>>>>
>>>>> Hi there
>>>>>
>>>>> I m using a TreePanel that can be checked; and was wondering what is
>>>>> the best way to get info back from the tree: ie all nodes whether they
>>>>> are checked or not , and I would like to know if they are.
>>>>>
>>>>> I know i can use treePanel.getChecked()  but that only gets me the
>>>>> checked ones
>>>>> or I can use  root.getChildNodes() but here I m not terribly sure how
>>>>> to know if its checked or not, it also seems quite cumbersome to
>>>>> navigate the tree structure this way
>>>>>
>>>>> any other alternatives? or recomended way to deal with trees in
>>>>> general?
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to