Hi!
I tried it this way:
if(path != null) {
//treeView.expandAll();
Path newPath = new Path();
for(Integer i : path) {
newPath.add(i);
treeView.expandBranch(path);
}
}
treeView.setSelectedPath(path);
But it doesn't work. It works if I call expandAll(). But that's not an option.
I have a search for the tree because the tree is so large :D
Did I maybe misunderstood you?
On Tue, May 4, 2010 at 12:30 AM, Greg Brown <[email protected]> wrote:
> I'm not as familiar with the inner workings of TreeView as Todd is, but I
> suspect that you may have to expand all branches in the path. Let me know if
> that doesn't work.
> G
>
> On May 3, 2010, at 10:40 AM, [email protected] wrote:
>
>> Hi!
>>
>> I've got a searchfunction for elements in my treeview.
>> The result of the search function is a path to the searched node.
>>
>> The problem now is, that the treeView doesn't want's to expand the branch
>> and set the selection.
>>
>> Even resetting the actual selection doesn't work.
>>
>> public void buttonPressed(Button button) {
>> String term = searchTerm.getText();
>> if(term.trim().length() == 0)
>> return;
>> //Path path = searchById(term);
>> //Path path = new Path(0,0,0,1);
>> Path path = treeView.getSelectedPath();
>> //Alert.alert("Hab da was: " + path.toString(), window.getDisplay());
>> if(path != null) {
>> treeView.collapseAll();
>> treeView.expandBranch(path);
>> treeView.setSelectedPath(path);
>> }
>> }
>>
>> As result I see a completely collapsed tree.
>>
>> What's wrong?
>>
>> thx!
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01