Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Automatic ID collision

    I am creating a treeGrid in a window as a picker component of a textItem.

    I am getting this error messages:
    Code:
    20:57:20.734 [ERROR] [zedes2V010214] 20:57:20.746:MUP6:WARN:Log:Specified ID: isc_ResultTree_1 collides with the ID for an existing SmartGWT component or object. The existing object will be destroyed and the ID bound to the new object.
    com.smartgwt.client.core.JsObject$SGWT_WARN: 20:57:20.746:MUP6:WARN:Log:Specified ID: isc_ResultTree_1 collides with the ID for an existing SmartGWT component or object. The existing object will be destroyed and the ID bound to the new object.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:304)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
        at com.smartgwt.client.util.SC.logWarn(SC.java)
        at com.smartgwt.client.util.IDManager.validateID(IDManager.java:75)
        at com.smartgwt.client.util.IDManager.registerID(IDManager.java:124)
        at com.smartgwt.client.core.BaseClass.registerID(BaseClass.java:77)
        at com.smartgwt.client.core.BaseClass.internalSetID(BaseClass.java:92)
        at com.smartgwt.client.widgets.tree.Tree.setJavaScriptObject(Tree.java:99)
        at com.smartgwt.client.widgets.tree.ResultTree.<init>(ResultTree.java:97)
        at com.smartgwt.client.widgets.tree.ResultTree.getOrCreateRef(ResultTree.java:86)
        at com.smartgwt.client.widgets.tree.TreeGrid.getData(TreeGrid.java:2750)
        at de.mks_infofabrik.zedes2.client.ui.widgets.boxes.EinrichtungenBox.isLeafSelected(EinrichtungenBox.java:316)
        at de.mks_infofabrik.zedes2.client.ui.widgets.boxes.EinrichtungenBox.onClick(EinrichtungenBox.java:459)
        at de.mks_infofabrik.zedes2.client.ui.widgets.boxes.EinrichtungenBox.onEinrichtungenClick(EinrichtungenBox.java:370)
        at de.mks_infofabrik.zedes2.client.ui.widgets.boxes.EinrichtungenBox$4.onCellDoubleClick(EinrichtungenBox.java:362)
        at com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent.dispatch(CellDoubleClickEvent.java:111)
        at com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent.dispatch(CellDoubleClickEvent.java:1)
        at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
        at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
        at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
        at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
        at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
        at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:356)
        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:745)
    I am NEVER setting the IDs, so all of them are automatically set by smartGwt. I tried to look at the developer console, to see why there is a isc_ResultTree_1 component , but I don't see any . (hidden/undrawn/generated activated). Only after the collision.

    My logs until the collision:
    Code:
    22:55:50.893:DEBUG:ResultTree:isc_ResultTree_0 (created by: isc_EinrichtungenTreeGrid_0):parent id: [root] (type: [root]) has childDS: einrichtungTreeNodes, relationship: {childDS: [DataSource ID:einrichtungTreeNodes],
    parentDS: [DataSource ID:einrichtungTreeNodes],
    isFolderProperty: undef,
    parentIdField: "Parent",
    idField: "KnotenId",
    rootValue: "/"}
    22:58:06.858:MUP6:DEBUG:ResultTree:isc_ResultTree_1 (created by: isc_EinrichtungenTreeGrid_1):parent id: [root] (type: [root]) has childDS: einrichtungTreeNodes, relationship: {childDS: [DataSource ID:einrichtungTreeNodes],
    parentDS: [DataSource ID:einrichtungTreeNodes],
    isFolderProperty: undef,
    parentIdField: "Parent",
    idField: "KnotenId",
    rootValue: "/"}
    22:58:29.653:MUP4:DEBUG:ResultTree:isc_ResultTree_1 (created by: isc_EinrichtungenTreeGrid_1):parent id: [root] (type: [root]) has childDS: einrichtungTreeNodes, relationship: {childDS: [DataSource ID:einrichtungTreeNodes],
    parentDS: [DataSource ID:einrichtungTreeNodes],
    isFolderProperty: undef,
    parentIdField: "Parent",
    idField: "KnotenId",
    rootValue: "/"}
    22:58:58.602:MUP9:DEBUG:ResultTree:isc_ResultTree_1 (created by: isc_EinrichtungenTreeGrid_1):parent id: [root] (type: [root]) has childDS: einrichtungTreeNodes, relationship: {childDS: [DataSource ID:einrichtungTreeNodes],
    parentDS: [DataSource ID:einrichtungTreeNodes],
    isFolderProperty: undef,
    parentIdField: "Parent",
    idField: "KnotenId",
    rootValue: "/"}
    22:59:22.834:MUP2:DEBUG:ResultTree:isc_ResultTree_1 (created by: isc_EinrichtungenTreeGrid_1):parent id: [root] (type: [root]) has childDS: einrichtungTreeNodes, relationship: {childDS: [DataSource ID:einrichtungTreeNodes],
    parentDS: [DataSource ID:einrichtungTreeNodes],
    isFolderProperty: undef,
    parentIdField: "Parent",
    idField: "KnotenId",
    rootValue: "/"}
    22:59:30.429:MUP1:WARN:Log:Specified ID: isc_ResultTree_1 collides with the ID for an existing SmartGWT component or object. The existing object will be destroyed and the ID bound to the new object.
    22:59:31.729:MUP2:DEBUG:ResultTree:isc_ResultTree_1 (created by: isc_EinrichtungenTreeGrid_1):parent id: [root] (type: [root]) has childDS: einrichtungTreeNodes, relationship: {childDS: [DataSource ID:einrichtungTreeNodes],
    parentDS: [DataSource ID:einrichtungTreeNodes],
    isFolderProperty: undef,
    parentIdField: "Parent",
    idField: "KnotenId",
    rootValue: "/"}
    Edit: I solved the problem by explicitely destroy()ing the tree when closing the window. But shouldn't automatic managing of IDs be collision-free?

    Using v9.1p_2014-09-25/PowerEdition Deployment (built 2014-09-25).
    Last edited by edulid; 5 Oct 2014, 15:15.

    #2
    Yes, it should be collision-free by default without any action on your part.

    It looks like you have a workaround, but if you can show how this can happen with valid usage we'd want to correct it.

    Comment


      #3
      Code:
      public class TestingModule implements EntryPoint {
      
      	ListGrid lg = new ListGrid();
      
      	public void onModuleLoad() {
      
      		VLayout vlayout = new VLayout();
      
      		DynamicForm df = new DynamicForm();
      		MyFormItem mfi = new MyFormItem();
      		mfi.setWidth(300);
      
      		df.setFields(mfi);
      
      		vlayout.addMember(df);
      		vlayout.setWidth(500);
      		vlayout.setHeight(500);
      		vlayout.draw();
      	}
      
      	private class MyFormItem extends StaticTextItem {
      
      		private MyDialog picker;
      
      		MyFormItem() {
      
      			PickerIcon clearPicker = new PickerIcon(PickerIcon.CLEAR,
      					new FormItemClickHandler() {
      						public void onFormItemClick(FormItemIconClickEvent event) {
      							clearValue();
      						}
      					});
      
      			PickerIcon searchPicker = new PickerIcon(PickerIcon.SEARCH,
      					new FormItemClickHandler() {
      						public void onFormItemClick(FormItemIconClickEvent event) {
      							Rectangle iconRect = getIconPageRect(event
      									.getIcon());
      
      							if (picker == null) {
      								picker = new MyDialog();
      							}
      							picker.reset();
      							picker.show();
      							picker.moveTo(iconRect.getLeft(), iconRect.getTop());
      						}
      					});
      
      			setIcons(clearPicker, searchPicker);
      
      		}
      
      		@Override
      		public MyDialog getPicker() {
      			return picker;
      		}
      
      	}
      
      	public class MyDialog extends Dialog {
      		TreeGrid employeeTreeGrid;
      
      		MyDialog() {
      			setWidth(700);
      			setHeight(470);
      			setAutoCenter(true);
      			setIsModal(true);
      			setShowHeader(false);
      			setShowEdges(false);
      			setEdgeSize(10);
      			setShowToolbar(false);
      
      			addCloseClickHandler(new CloseClickHandler() {
      
      				@Override
      				public void onCloseClick(CloseClickEvent event) {
      					hide();
      				}
      			});
      
      			VLayout vlayout = new VLayout(10);
      
      			employeeTreeGrid = new TreeGrid();
      			employeeTreeGrid.setWidth(500);
      			employeeTreeGrid.setHeight(400);
      			employeeTreeGrid.setNodeIcon("icons/16/person.png");
      			employeeTreeGrid.setFolderIcon("icons/16/person.png");
      			employeeTreeGrid.setAutoFetchData(false);
      			
      			employeeTreeGrid.setShowOpenIcons(false);
      			employeeTreeGrid.setShowDropIcons(false);
      
      			employeeTreeGrid.setShowSelectedStyle(true);
      			employeeTreeGrid.setShowPartialSelection(false);
      			employeeTreeGrid.setCascadeSelection(false);
      			employeeTreeGrid.setCanSort(false);
      			employeeTreeGrid.setShowConnectors(true);
      			employeeTreeGrid.setShowHeader(false);
      			employeeTreeGrid.setLoadDataOnDemand(false);
      			employeeTreeGrid.setSelectionType(SelectionStyle.SINGLE);
      			employeeTreeGrid.setOverflow(Overflow.AUTO);
      			
      			employeeTreeGrid.setShowAllRecords(true);
      
      			vlayout.addMember(employeeTreeGrid);
      			employeeTreeGrid.setDataSource(EmployeeXmlDS.getInstance());
      			employeeTreeGrid.fetchData(null, new DSCallback() {
      				
      				@Override
      				public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
      					employeeTreeGrid.getTree().openAll();
      				}
      			});
      
      			HLayout buttonLayout = new HLayout(5);
      
      			IButton okButton = new IButton("Fetch tree");
      			okButton.addClickHandler(new ClickHandler() {
      
      				@Override
      				public void onClick(ClickEvent event) {
      					employeeTreeGrid.setDataSource(EmployeeXmlDS.getInstance());
      					employeeTreeGrid.fetchData(null, new DSCallback() {
      						
      						@Override
      						public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
      							employeeTreeGrid.getTree().openAll();
      						}
      					});
      				}
      			});
      
      			buttonLayout.addMember(okButton);
      
      			IButton closeButton = new IButton("Close");
      			closeButton.addClickHandler(new ClickHandler() {
      
      				@Override
      				public void onClick(ClickEvent event) {
      					hide();
      				}
      			});
      
      			buttonLayout.addMember(closeButton);
      			vlayout.addMember(buttonLayout);
      
      			addItem(vlayout);
      		}
      
      		public void reset() {
      			employeeTreeGrid.setData(new ListGridRecord[] {});
      		}
      	}
      
      }
      Just click in the magnifier, then two times on "fetch tree", then you will see this:
      Code:
      08:51:13.611:INFO:Log:initialized
      08:51:28.434:INFO:Log:isc.Page is loaded
      08:51:43.892:MUP8:DEBUG:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):parent id: [root] (type: [root]) has childDS: employeesDS, relationship: {childDS: [DataSource ID:employeesDS],
      parentDS: [DataSource ID:employeesDS],
      isFolderProperty: undef,
      parentIdField: "ReportsTo",
      idField: "EmployeeId",
      rootValue: "1"}
      08:51:47.150:MUP8:DEBUG:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):parent id: [root] (type: [root]) has childDS: employeesDS, relationship: {childDS: [DataSource ID:employeesDS],
      parentDS: [DataSource ID:employeesDS],
      isFolderProperty: undef,
      parentIdField: "ReportsTo",
      idField: "EmployeeId",
      rootValue: "1"}
      08:52:05.171:MUP5:DEBUG:ResultTree:isc_ResultTree_0 (created by: isc_TreeGrid_0):parent id: [root] (type: [root]) has childDS: employeesDS, relationship: {childDS: [DataSource ID:employeesDS],
      parentDS: [DataSource ID:employeesDS],
      isFolderProperty: undef,
      parentIdField: "ReportsTo",
      idField: "EmployeeId",
      rootValue: "1"}
      08:52:05.302:TMR0:WARN:Log:Specified ID: isc_ResultTree_0 collides with the ID for an existing SmartGWT component or object. The existing object will be destroyed and the ID bound to the new object.
      The collision:
      08:52:05.302:TMR0:WARN:Log:Specified ID: isc_ResultTree_0 collides with the ID for an existing SmartGWT component or object. The existing object will be destroyed and the ID bound to the new object.

      Comment


        #4
        Were you able to reproduce the problem with my test case? I would prefer to remove the workaround for this issue.

        Maybe this is related to another thread: http://forums.smartclient.com/showthread.php?t=30610 where automatic ids seem to be colliding too.

        Comment


          #5
          This should be resolved by the next nightly builds.

          Comment

          Working...
          X