Announcement

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

    #61
    Here is my test case:
    Code:
    private ListGrid grid;
    
        public void onModuleLoad() {
            HLayout layout = new HLayout();  
            layout.setWidth(300);
            layout.setHeight(200);
            layout.setMembersMargin(20);
    
    
    
            grid = new ListGrid();
    
            
            ListGridRecord record1 = new ListGridRecord();
            record1.setAttribute("one", "1");
            record1.setAttribute("two", "1");
            record1.setAttribute("three", "1");
    
            ListGridRecord record2 = new ListGridRecord();
            record2.setAttribute("one", "2");
            record2.setAttribute("two", "2");
            record2.setAttribute("three", "2");
    
            ListGridRecord record3 = new ListGridRecord();
            record3.setAttribute("one", "3");
            record3.setAttribute("two", "3");
            record3.setAttribute("three", "3");
    
            ListGridRecord[] records = new ListGridRecord[3];
            records[0] = record1;
            records[1] = record2;
            records[2] = record3;
    
            ListGridField field0 = new ListGridField("Select");
            field0.setType(ListGridFieldType.BOOLEAN);
            field0.setCanEdit(Boolean.TRUE);
            field0.setCanToggle(Boolean.TRUE);
            field0.addChangedHandler(new ChangedHandler() {
    
                public void onChanged(ChangedEvent event) {
    
                    GWT.log("col:" + event.getColNum() + " row:" + event.getRowNum(), null);
    
                }
            });
    
    
            ListGridField field1 = new ListGridField("one", "one");
            ListGridField field2 = new ListGridField("two", "two");
            ListGridField field3 = new ListGridField("three", "three");
            ListGridField[] fields = new ListGridField[4];
            fields[0] = field0;
            fields[1] = field1;
            fields[2] = field2;
            fields[3] = field3;
    
    
            grid.setAutoFetchData(Boolean.FALSE);
            grid.setEditEvent(ListGridEditEvent.NONE);
            grid.setAutoSaveEdits(Boolean.FALSE);
            grid.setFields(fields);
            grid.setData(records);
            
    
    
            layout.addMember(grid);
    
            DynamicForm df = new DynamicForm();
            CheckboxItem check = new CheckboxItem("checkbox1", "Check");
            df.setItems(check);
            layout.addMember(df);
    
    
            layout.draw();
        }

    I'm now seeing this error:
    Code:
    Uncaught JavaScript exception [java.lang.ClassCastException: com.smartgwt.client.widgets.grid.ListGridField cannot be cast to com.smartgwt.client.widgets.grid.ListGrid
    Uncaught JavaScript exception [java.lang.ClassCastException: com.smartgwt.client.widgets.grid.ListGridField cannot be cast to com.smartgwt.client.widgets.grid.ListGrid
            at com.smartgwt.client.widgets.grid.events.ChangedEvent.getEventColumn(ChangedEvent.java:153)
            at com.smartgwt.client.widgets.grid.events.ChangedEvent.getColNum(Native Method)
            at com.smartgwt.client.widgets.grid.events.ChangedEvent.getColNum(Native Method)
            at org.yournamehere.client.MainEntryPoint$1.onChanged(MainEntryPoint.java:124)
            at com.smartgwt.client.widgets.grid.events.ChangedEvent.dispatch(ChangedEvent.java:97)
            at com.smartgwt.client.widgets.grid.events.ChangedEvent.dispatch(ChangedEvent.java:1)
            at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
            at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
            at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
            at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:237)] in http://localhost:8084/WebApplication1/org.yournamehere.Main/hosted.html?org_yournamehere_Main, line 8

    Comment


      #62
      ah, you're right - looking into it.

      Comment


        #63
        This issue has taken us quite a few iterations on this message board in this thread and we have not gotten it resolved.

        I would like to call out that our release schedule has been delayed because of this specific issue and our COO is getting concerned.

        Comment


          #64
          You are not blocked - call listGrid.getEventRow()/listGrid.getEventColumn() directly - we are just fixing a convenience API.

          Comment


            #65
            Can we expect to see the convenience methods fixed in tomorrow's build? We are on the East Coast and given our time differences, I would like to come in first thing tomorrow and use the nightly builds for the fix?

            Comment


              #66
              Originally posted by Isomorphic
              You are not blocked - call listGrid.getEventRow()/listGrid.getEventColumn() directly - we are just fixing a convenience API.
              Just to clarify, today's build where my test case failed, did not impact our release schedule, it was the length of time it took on the message boards to get our issue resolved. All the back and forth we've been doing over this issue.

              An API upgrade like what we are faced with, upgrading the nightly build will require us to do a full regression test of our application, and that takes us quite a bit of time to do.

              It was the sheer amount of time on this message board/thread that pushed our release schedule out, and made our date slip.

              Comment


                #67
                That's unfortunate, however, we're not sure what your getting at by mentioning your slip and your COO in this thread.

                Most of this thread consisted of us trying to find a problem that wasn't there, because it only occurred in a customized skin, but you never tested it without your skin, so we wasted a large amount of time running in circles.

                Then there were some usage clarifications. Finally, a misbehaving convenience method with a very easy workaround.

                We don't of any reason why you can't deploy with 2.4, or with whatever you previously regression tested against, by simply applying this easy workaround.

                Comment


                  #68
                  The problem was there and had nothing to do with our skin. The test cases I started to post in this thread were test cases using the default skin. The problem identified was setting the ListGridField state to canToggle which was skin independent.

                  Agreed, we both spent considerable time on this thread.

                  Regardless, I will try the work around to avoid a further upgrade if possible.

                  Comment


                    #69
                    This is a further waste of time, but because you've started talking about your COO and project slips we have to correct this.

                    After speculating a while with Support about different possible causes of bad boolean rendering, in your post #24 you produced a test case which did not reproduce the problem with any default skin. It was finally revealed in posts #34-36 that a combination of settings not shown in your test case (canToggle:true for a non-editable field) was correctly causing the checkbox to be shown in disabled state - a state which evidently had no media or the wrong media in your skin.

                    In a nutshell, as soon as you gave us information that could possibly have allowed us to solve the problem, we did - in 2.5 hours. And this was from extremely indirect information - a snapshot of the DOM that happened to reveal settings you had not previously revealed.

                    Sorry to have to post this correction but we need to do this type of thing when there is a suggestion (even an oblique one) that Support is causing some kind of delay. You will note that we will cheerfully accept blame when we are at fault, and do whatever we can to make up for it.

                    Comment


                      #70
                      Just FYI, last night's build was delayed slightly by unrelated errors (it completed at 10am EST), but the convenience methods should be working now (although as previously indicated, sticking with 2.4 or an earlier seems to work for you and prevent re-testing).
                      Last edited by Isomorphic; 21 Jan 2011, 12:12.

                      Comment


                        #71
                        Hi!

                        I am using SmartGWT 2.1 and I ahve a ListGrid with ListGridField that should be a checkbox but even if I am setting the value to "true" it still doesn't display a check on the checkbox.

                        Here's the sample code:
                        private void formatGrid() {
                        BaseDetailGrid bucketInhibitorGrid = new BaseDetailGrid(); // where BaseDetailGrid extends ListGrid
                        bucketInhibitorGrid.setStyleName(TABL_LOCAL_CLS);
                        bucketInhibitorGrid.setBodyOverflow(Overflow.AUTO);
                        bucketInhibitorGrid.setCanEdit(false);
                        bucketInhibitorGrid.setFields(defaultFieldWidths);
                        bucketInhibitorGrid.setWidth(490);
                        bucketInhibitorGrid.setHeight(170);
                        bucketInhibitorGrid.setMargin(6);
                        }

                        private ListGridField[] defaultFieldWidths = {
                        getField( BKT_FLD_INHIBITOR, BKT_LBL_INHIBITOR, 120),
                        getCheckBoxField( PS_FLD_INHIBITOR, PS_LBL_INHIBITOR, 40),
                        getCheckBoxField( W_FLD_INHIBITOR, W_LBL_INHIBITOR, 40),
                        };

                        private ListGridField getCheckBoxField(String name, String label, int width) {
                        ListGridField field = new ListGridField(name, label, width);
                        field.setHeaderTitleStyle(WHITE_TITLE_CLS);
                        field.setType(ListGridFieldType.BOOLEAN);
                        field.setCanEdit(Boolean.TRUE);
                        field.setCanToggle(Boolean.TRUE);
                        return field;
                        }

                        public void setData(DetailTO currentDetailTo) {
                        NestedDetailTO nestedTO = (NestedDetailTO) currentDetailTo;
                        bucketInhibitorGrid.setData(createInhibitorRecord(nestedTO.getData()));
                        }

                        private ListGridRecord[] createInhibitorRecord(List list){
                        ListGridRecord[] records = new ListGridRecord[list.size()];
                        for (int i=0; i < list.size(); i++){
                        records[i] = inhibitorToRecord(list.get(i));
                        }
                        return records;
                        }

                        private ListGridRecord inhibitorToRecord(Object inhibitorObject) {
                        ListGridRecord record = new ListGridRecord();

                        NestedTO nestedTO = (NestedTO) inhibitorObject;
                        record.setAttribute(BKT_FLD_INHIBITOR, nestedTO.gettCode());
                        record.setAttribute(PS_FLD_INHIBITOR, true);
                        record.setAttribute(W_FLD_INHIBITOR, false);
                        }

                        Thanks in advance!
                        Last edited by ricD; 14 Apr 2011, 07:26.

                        Comment

                        Working...
                        X