Thank you!
Announcement
Collapse
No announcement yet.
X
-
Code:public void testcase7() { class RecordNode extends TreeNode { public RecordNode(boolean isOpen, Integer id, Integer pid, String name1, Double name2, Double name3, Double name4, Double name5, Double name6, Double name7, Double name8) { super(); this.setId(id); this.setPid(pid); this.setName("name1"); this.setAttribute("isOpen", isOpen); this.setName1(name1); this.setName2(name2); this.setName3(name3); this.setName4(name4); this.setName5(name5); this.setName6(name6); this.setName7(name7); this.setName8(name8); } public void setId(Integer id) { setAttribute("id", id); } public void setPid(Integer pid) { setAttribute("pid", pid); } public void setName1(String name1) { setAttribute("name1", name1); } public void setName2(Double name2) { setAttribute("name2", name2); } public void setName3(Double name3) { setAttribute("name3", name3); } public void setName4(Double name4) { setAttribute("name4", name4); } public void setName5(Double name5) { setAttribute("name5", name5); } public void setName6(Double name6) { setAttribute("name6", name6); } public void setName7(Double name7) { setAttribute("name7", name7); } public void setName8(Double name8) { setAttribute("name8", name8); } } VLayout vLayout = new VLayout(); HLayout mainHLayout = new HLayout(0); mainHLayout.setBackgroundColor("#CCCCCC"); mainHLayout.setOverflow(Overflow.HIDDEN); mainHLayout.setHeight100(); mainHLayout.setWidth100(); VLayout gridVLayout; gridVLayout = new VLayout(0); final TreeGrid treeGrid = new TreeGrid(); final ListGridField field1= new ListGridField("name1", "Name 1", 200); final ListGridField field2 = new ListGridField("name2", "Name 2", 100); final ListGridField field3 = new ListGridField("name3", "Name 3", 100); final ListGridField field4 = new ListGridField("name4", "Name 4", 100); final ListGridField field5 = new ListGridField("name5", "Name 5", 100); final ListGridField field6 = new ListGridField("name6", "Name 6", 100); final ListGridField field7 = new ListGridField("name7", "Name 7", 100); final ListGridField field8 = new ListGridField("name8", "Name 8", 100); ListGridField [] fields = {field1, field2, field3, field4, field5, field6, field7, field8}; int x = 0; for(ListGridField field : fields) { x++; field.setPrompt("name" + x); if(x > 1) field.setType(ListGridFieldType.FLOAT); else field.setType(ListGridFieldType.TEXT); } Tree newTree = new Tree(); newTree.setRootValue(0); newTree.setModelType(TreeModelType.PARENT); newTree.setNameProperty("name1"); newTree.setIdField("id"); newTree.setParentIdField("pid"); newTree.setOpenProperty("isOpen"); TreeNode[] nodeList = new TreeNode[]{ new RecordNode(true, 0, null, "one", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(false, 1, 0, "two", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(false, 2, 0, "three", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 3, null, "four", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 4, 3, "five", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 5, 3, "six", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), }; newTree.setData(nodeList); treeGrid.setNodeIcon(null); treeGrid.setFolderIcon(null); treeGrid.setSelectionType(SelectionStyle.MULTIPLE); treeGrid.setAlternateRecordStyles(Boolean.TRUE); treeGrid.setCanReorderFields(Boolean.FALSE); treeGrid.setCanPickFields(Boolean.FALSE); treeGrid.setCanResizeFields(Boolean.TRUE); treeGrid.setResizeFieldsInRealTime(Boolean.FALSE); treeGrid.setAlternateRecordStyles(Boolean.TRUE); treeGrid.setEmptyCellValue("---"); treeGrid.setCanAutoFitFields(Boolean.FALSE); treeGrid.setHeight100(); treeGrid.setWidth100(); treeGrid.setShowOpenIcons(Boolean.FALSE); treeGrid.setData(newTree); treeGrid.setFields(fields); gridVLayout.addMember(treeGrid); gridVLayout.setMargin(0); gridVLayout.setPadding(0); gridVLayout.setBorder(null); gridVLayout.setBackgroundColor("#FFFFFF"); gridVLayout.setHeight100(); gridVLayout.setShowResizeBar(Boolean.TRUE); gridVLayout.setResizeBarTarget("next"); gridVLayout.setWidth100(); Canvas left = new Canvas(); left.setBackgroundColor("green"); left.setShowResizeBar(Boolean.TRUE); left.setWidth(300); Canvas right = new Canvas(); right.setBackgroundColor("green"); right.setWidth(300); mainHLayout.addMember(left); mainHLayout.addMember(gridVLayout); mainHLayout.addMember(right); vLayout.addMember(mainHLayout); window = new Window(); window.setTitle("View: " + "Columns do not align TEST"); window.setWidth("40%"); window.setMinWidth(825); window.setHeight("40%"); window.setMinHeight(300); window.setShowMaximizeButton(Boolean.TRUE); window.setShowCloseButton(Boolean.TRUE); window.setShowMinimizeButton(Boolean.TRUE); window.setAutoCenter(Boolean.TRUE); window.setCanDragResize(true); window.setShowStatusBar(Boolean.TRUE); window.addItem(vLayout); window.setOverflow(Overflow.HIDDEN); window.show(); }
The behavior we're seeing is limited to IE. What happening is when you have the 2 side panels expanded, and you open up a collapse node, when the node expands, all the columns shift over to the right as small as possible w/o hiding any data with no respect to the columns. When you collapse the grid node which causes the issue, the columns go back and they align with the columns.
So it appears to be an issue with expanding nodes.
Comment
-
yes, this example that i'm posting is integrated into our project, so it's running side by side with our misbehaving grid. so it's a matter of adding grid specifics from the bad grid to the example test case until it starts misbehaving. at that point, hopefully i'll have a misbehaving example i'll repost.
Comment
-
Also, we would recommend trying to reproduce this effect from a second machine, partly because IE has some weird bugs that occur if you manually toggle between standards mode and quirks mode use IE's Developer Tools.
Sometimes, a specific developer machine where this has been done will remain stuck in quirks mode (or a strange "in between" mode that isn't supposed to exist..) even when the page specifies standard mode.
Comment
-
I've narrowed the issue down: when you have columns that go past the size of the grid (you have a scroll bar on the bottom of the grid to scroll to the right to see the hidden columns) only in this case, when you expand a node do we get this bad behavior. When we have all the columns showing in the grid (no horizontal scroll bar) the grid behaves properly when expanding nodes.
Hope this helps at all.
Comment
-
Further characterization of the issue, the problem only exists when there is 2 or more fields on the right that are not visible in the grid, where you would have to move the horizontal scroll bar over to the right to see the last two fields.
When there is only the last field on the right not visible, expansion of a tree node works fine and the columns align.
More to come...
Comment
-
I've replicated the issue in this standalone test case. Please confirm on your side.
Code:public void testcase7() { class RecordNode extends TreeNode { public RecordNode(boolean isOpen, Integer id, Integer pid, String name1, Double name2, Double name3, Double name4, Double name5, Double name6, Double name7, Double name8) { super(); this.setId(id); this.setPid(pid); this.setName("name1"); this.setAttribute("isOpen", isOpen); this.setName1(name1); this.setName2(name2); this.setName3(name3); this.setName4(name4); this.setName5(name5); this.setName6(name6); this.setName7(name7); this.setName8(name8); } public void setId(Integer id) { setAttribute("id", id); } public void setPid(Integer pid) { setAttribute("pid", pid); } public void setName1(String name1) { setAttribute("name1", name1); } public void setName2(Double name2) { setAttribute("name2", name2); } public void setName3(Double name3) { setAttribute("name3", name3); } public void setName4(Double name4) { setAttribute("name4", name4); } public void setName5(Double name5) { setAttribute("name5", name5); } public void setName6(Double name6) { setAttribute("name6", name6); } public void setName7(Double name7) { setAttribute("name7", name7); } public void setName8(Double name8) { setAttribute("name8", name8); } } VLayout vLayout = new VLayout(); HLayout mainHLayout = new HLayout(0); mainHLayout.setBackgroundColor("#CCCCCC"); mainHLayout.setOverflow(Overflow.HIDDEN); mainHLayout.setHeight100(); mainHLayout.setWidth100(); VLayout gridVLayout; gridVLayout = new VLayout(0); final TreeGrid treeGrid = new TreeGrid(); String[] fieldNames = {"name1","name2","name3","name4","name5","name6","name7","name8"}; TreeGridField [] fields = { new TreeGridField(fieldNames[0], "Name 1", 200), new TreeGridField(fieldNames[1], "Name 2", 100), new TreeGridField(fieldNames[2], "Name 3", 100), new TreeGridField(fieldNames[3], "Name 4", 100), new TreeGridField(fieldNames[4], "Name 5", 100), new TreeGridField(fieldNames[5], "Name 6", 100), new TreeGridField(fieldNames[6], "Name 7", 100), new TreeGridField(fieldNames[7], "Name 8", 100) }; int x = 0; for(TreeGridField field : fields) { x++; if(x == 0) field.setType(ListGridFieldType.TEXT); if(x >= 1) { field.setCanFreeze(Boolean.FALSE); field.setType(ListGridFieldType.FLOAT); } field.setCanHide(Boolean.TRUE); //field.setHidden(Boolean.TRUE); //field.setAttribute("mid", x); //CellFormatter cf = new PivotTableCellFormatter(m.getFormat()); //field.setCellFormatter(cf); //field.setSortNormalizer(numericSortNormalizer); // field.setType(ListGridFieldType.FLOAT); //field.setShowHover(Boolean.TRUE); field.setPrompt("This is a field prompt and is meant to show more information + " + x); } Tree newTree = new Tree(); newTree.setRootValue(0); newTree.setModelType(TreeModelType.PARENT); newTree.setNameProperty("name1"); newTree.setIdField("id"); newTree.setParentIdField("pid"); newTree.setOpenProperty("isOpen"); TreeNode[] nodeList = new TreeNode[]{ new RecordNode(true, 0, null, "one", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(false, 1, 0, "two", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(false, 2, 0, "three", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 3, null, "four", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 4, 3, "five", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 5, 3, "six", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 6, 2, "seven", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 7, 2, "eight", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 8, 1, "nine", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 9, 1, "ten", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 10, 1, "eleven", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 11, 1, "twelve", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 12, 2, "thirteen", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 13, 0, "fourteen", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 14, 0, "fifteen", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 15, 3, "sixteen", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 16, 2, "seventeen", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343), new RecordNode(true, 17, 1, "eighteen", 1.23, 1.34, 2.54, 1.66, 1.567, 1.456, 1.2343) }; newTree.setData(nodeList); treeGrid.setNodeIcon(null); treeGrid.setFolderIcon(null); treeGrid.setSelectionType(SelectionStyle.MULTIPLE); treeGrid.setAlternateRecordStyles(Boolean.TRUE); treeGrid.setCanReorderFields(Boolean.FALSE); treeGrid.setCanPickFields(Boolean.FALSE); treeGrid.setCanResizeFields(Boolean.TRUE); treeGrid.setResizeFieldsInRealTime(Boolean.FALSE); treeGrid.setAlternateRecordStyles(Boolean.TRUE); treeGrid.setEmptyCellValue("---"); treeGrid.setCanAutoFitFields(Boolean.FALSE); treeGrid.setHeight100(); treeGrid.setWidth100(); treeGrid.setShowOpenIcons(Boolean.FALSE); treeGrid.setData(newTree); treeGrid.setFields(fields); gridVLayout.addMember(treeGrid); gridVLayout.setMargin(0); gridVLayout.setPadding(0); gridVLayout.setBorder(null); gridVLayout.setBackgroundColor("#FFFFFF"); gridVLayout.setHeight100(); gridVLayout.setShowResizeBar(Boolean.TRUE); gridVLayout.setResizeBarTarget("next"); gridVLayout.setWidth100(); Canvas left = new Canvas(); left.setBackgroundColor("green"); left.setShowResizeBar(Boolean.TRUE); left.setWidth(300); Canvas right = new Canvas(); right.setBackgroundColor("green"); right.setWidth(300); mainHLayout.addMember(left); mainHLayout.addMember(gridVLayout); mainHLayout.addMember(right); vLayout.addMember(mainHLayout); window = new Window(); window.setTitle("View: " + "Columns do not align TEST"); window.setWidth("40%"); window.setMinWidth(825); window.setHeight("40%"); window.setMinHeight(300); window.setShowMaximizeButton(Boolean.TRUE); window.setShowCloseButton(Boolean.TRUE); window.setShowMinimizeButton(Boolean.TRUE); window.setAutoCenter(Boolean.TRUE); window.setCanDragResize(true); window.setShowStatusBar(Boolean.TRUE); window.addItem(vLayout); window.setOverflow(Overflow.HIDDEN); window.show(); for(String field : fieldNames) { treeGrid.showField(field); } }
Comment
-
Originally posted by JLivermore View PostI think I found how to create a TreeNode so I made some changes, but I still cannot get this example to run.
Code:public void testcase7() { : newTree.setData(nodeList); treeGrid.getData().destroy(); treeGrid.setData(newTree); : }
Code:ERROR: Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(1283), JavaScript object(1280), JavaScript object(1342)]): Unable to get property 'getClassName' of undefined or null reference at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249) 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:347) at sun.reflect.GeneratedMethodAccessor84.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:744)
Comment
Comment