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

Reply via email to