try removing the call to expand and set setExpanded(true) to the node...try
this way:
root = new TreeNode() {
{
   setExpanded(true);
}
};

2009/8/31 Kedar <[email protected]>

>
> Hi
>    I am trying to create a tree which will show list of developers
> from database on screen. It worked fine in hosted mode but when i
> deploy the application it gives 'firstChild is null or not an object'
> exception.
>    Then i try to do the same with some dummy data and only tree panel
> on page but still i got the same error.
>     I am giving here the code which troubled me, please help me to
> solve this out.
>
> public class Test
> {
>        //Outer scope panel to be accessed from outside
>        Panel searchProjectPanel = new Panel();
>
>        //Tree Panel
>    TreePanel devPanel = new TreePanel();
>    TreeNode root;
>
>        public Test()
>        {
>                try
>                {
>
>                        devPanel.setHeight(100);
>                devPanel.setWidth(230);
>                devPanel.setAutoScroll(true);
>                devPanel.setRootVisible(true);
>
>                //Append a dummy child for the first time
>                Window.alert("Some Dummy Nodes");
>                TreeNode dummy1 = new TreeNode("Dummy Child");
>                TreeNode dummy2 = new TreeNode("Dummy Child");
>
>                root = new TreeNode("<b>Developers<b>");
>                root.appendChild(dummy1);
>                root.appendChild(dummy2);
>                root.expand();
>
>                Window.alert("Some Dummy Nodes Added to Root");
>                devPanel.setRootNode(root);
>
>                Window.alert("Root Addedd to Panel");
>                searchProjectPanel.add(devPanel);
>                }
>                catch(Exception e)
>                {
>                        Window.alert("Exception in Test : " +
> e.getMessage());
>                }
>
>        }
> }
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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