I just upgraded to the latest release of Smart GWT 2.1 and my code is now throwing an exception when I double-click a leaf tree node (which creates a Tab in a TabSet). Here's the exception and the TreeGrid code, please let me know if you can shed any light on what the problem might be:
Exception:
07:59:25.907 [ERROR] [imod] 07:59:25.911:MUP6:WARN:TreeGridBody:isc_OID_29_body:startRowAnimation passed empty row range, aborting: 2,2
com.smartgwt.client.core.JsObject$SGWT_WARN: 07:59:25.911:MUP6:WARN:TreeGridBody:isc_OID_29_body:startRowAnimation passed empty row range, aborting: 2,2
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)
Code:
public class IMODTreeGrid extends TreeGrid
{
public IMODTreeGrid(int type)
{
setSelectionType(SelectionStyle.SINGLE);
TreeNode rootTreeNode = null;
String dragType = null;
switch (type)
{
case IMODTreeNode.TREE_TYPE_DIGITALASSETS:
dragType = "digitalAsset";
rootTreeNode = new IMODTreeNode("Root", null, null, IMODTreeNode.TREE_TYPE_DIGITALASSETS,
new IMODTreeNode("Resource Library", null, null, IMODTreeNode.TREE_TYPE_FOLDER,
new IMODTreeNode("Empty Email Template", "content_library.png", null, IMODTreeNode.TREE_TYPE_DIGITALASSET)));
break;
default:
break;
}
setWidth("100%");
setHeight("100%");
setOpacity(new Integer(100));
setBackgroundColor("white");
setBodyStyleName("normal");
setShowHeader(Boolean.FALSE);
setLeaveScrollbarGap(Boolean.FALSE);
setCanReorderRecords(Boolean.FALSE);
setCanHover(Boolean.TRUE);
setShowHover(Boolean.TRUE);
setHoverWidth(10);
setHoverWrap(Boolean.FALSE);
setCanDragResize(Boolean.FALSE);
setCanDragReposition(Boolean.FALSE);
setCanAcceptDroppedRecords(Boolean.FALSE);
setCanDragRecordsOut(Boolean.TRUE);
setCanDrag(Boolean.TRUE);
setDragDataAction(DragDataAction.COPY);
setDragType(dragType);
setShowConnectors(Boolean.TRUE);
Tree tree = new Tree();
tree.setModelType(TreeModelType.CHILDREN);
tree.setNameProperty("name");
tree.setRoot(rootTreeNode);
setData(tree);
TreeGridField nameField = new TreeGridField();
nameField.setName("name");
nameField.setHoverCustomizer(new HoverCustomizer()
{
public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum)
{
return ("<NOBR>" + record.getAttribute("name") + "<NOBR>");
}
});
setFields(nameField);
getData().openAll();
}
class IMODTreeNode extends TreeNode
{
public final static int TREE_TYPE_DIGITALASSETS = 6;
public final static int TREE_TYPE_DIGITALASSET = 7;
public IMODTreeNode(String name, String icon, String image, int type)
{
this(name, icon, image, type, -1);
}
public IMODTreeNode(String name, String icon, String image, int type, int subType)
{
this(name, icon, image, type, new IMODTreeNode[]{});
if (subType > -1)
{
setAttribute("subType", subType);
}
}
public IMODTreeNode(String name, String icon, String image, int type, IMODTreeNode... children)
{
setAttribute("name", name);
if (icon != null)
{
setAttribute("icon", icon);
}
setAttribute("type", type);
setAttribute("image", image);
setAttribute("children", children);
}
public boolean isLeaf()
{
return (!(getAttributeAsInt("type").intValue() == IMODTreeNode.TREE_TYPE_FOLDER));
}
}
}
07:59:25.907 [ERROR] [imod] 07:59:25.911:MUP6:WARN:TreeGridBody:isc_OID_29_body:startRowAnimation passed empty row range, aborting: 2,2
com.smartgwt.client.core.JsObject$SGWT_WARN: 07:59:25.911:MUP6:WARN:TreeGridBody:isc_OID_29_body:startRowAnimation passed empty row range, aborting: 2,2
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)
Comment