Announcement

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

    #16
    Thank you!

    Comment


      #17
      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();
          }
      OK...the example posted does not display the behavior we are seeing in our TreeGrid. I've tried to build the window similar to our window with our TreeGrid that does not align the columns properly and I can't seem to replicate the issue in a simple stand alone test case.

      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


        #18
        All we can recommend at the moment is to keep going with standard problem isolation approaches.

        For example, add this exact code to your project - if it misbehaves, there's some global setting / skinning in your project causing the problem.

        Comment


          #19
          Here is an attached image to see the alignment issue.
          Attached Files

          Comment


            #20
            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


              #21
              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


                #22
                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


                  #23
                  It may help, if that means you can replicate the behavior in the standalone case by twiddling column widths and/or settings such as autofit.

                  Otherwise, it may be a necessary but not sufficient condition, and we still don't have a way to replicate the issue.

                  Comment


                    #24
                    I completely understand. W/o a way for you to replicate the issue, there's not much to do. :)

                    Comment


                      #25
                      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


                        #26
                        Further characterization - When you expand a node, you only see data in the next 2 hidden fields, any fields past the next two hidden, the data disappears when the node get expanded and the data shifts to the left. So any data past 2 hidden columns goes missing when you expand a node.

                        Comment


                          #27
                          Further characterization - if you have a tree 3 nodes deep all collapsed at the root node. When you expand the root node, first level deep expands with no problems, the columns align. This problem only happens when you expand nodes deeper than the root node.

                          Comment


                            #28
                            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


                              #29
                              Were you able to reproduce the issue with the test case?

                              Comment


                                #30
                                Originally posted by JLivermore View Post
                                I 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);
                                            :
                                    }
                                I'm still seeing this error in the dev console:
                                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)
                                What seems to be the issue in the new test case above?
                                The internal JS error was of a result a problem with our implementation of SGWT TreeGrid.getData(), and has been fixed in SGWT 5.0d-3.1p (check the next nightlies), but your use of the result should also have been null checked. (Since the destroy() call itself is not needed, the fix is even simpler, so this is mostly just for informative purposes.)

                                Comment

                                Working...
                                X