Announcement

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

    #16
    in my test case, I have 4 ListGridRecords, 3 of them are marked as true and the last is marked as false using the code I provided above. So I should see 3 check boxes with checks and 1 empty check box.

    They all render and 4 empty check boxes.

    Comment


      #17
      Can you provide the full path of the checked image and unchecked image so I can verify in my skins?

      Comment


        #18
        SC_SNAPSHOT-2011-01-06/PowerEdition Deployment 2011-01-06
        GWT 1.7.1
        IE 7 Developers Console

        Here is how we are using the ListGridField checkbox:

        Declaration
        Code:
        final ListGridField selectBox = new ListGridField("Select");
        selectBox.setType(ListGridFieldType.BOOLEAN);
        selectBox.setDefaultValue(false);
        selectBox.setWidth(46);
        onRecordClick callback
        Code:
        if(listGridRecord != null) {
             if(listGridRecord.getAttribute("Select") == null
             || !Boolean.parseBoolean(listGridRecord.getAttribute("Select").toString())) {
                  listGridRecord.setAttribute("Select", Boolean.TRUE);
        }
        else {
                  listGridRecord.setAttribute("Select", Boolean.FALSE);
        }
        grid.refreshCell(event.getRecordNum(), event.getFieldNum());
            refreshChartPanel();
        }
        onDataArrived callback in the ListGrid
        Code:
        if( (listGridRecord.getAttribute("Select") == null
             || !Boolean.parseBoolean(listGridRecord.getAttribute("Select").toString()))
             && i <= 2 ) {
            listGridRecord.setAttribute("Select", Boolean.TRUE);
        }
        else {
             listGridRecord.setAttribute("Select", Boolean.FALSE);
        }
        Note - we do not have a corresponding DataSourceField in the DataSource that correlates to this ListGridField like the previous customer (and the Showcase example) has in this thread.

        Again, the code functionally works when we click on the check box, the only thing that does work is we see no check in the box when the value is set to Boolean.TRUE.

        Please advise.
        Last edited by jasmith; 7 Jan 2011, 05:52.

        Comment


          #19
          Can you clarify, are you seeing:

          1. a problem with boolean values returned from the server not rendering properly (we asked for the RPC tab output to troubleshoot this)

          2. a problem where records that have boolean values programmatically set *before any grid interactions have occurred*

          3. only a problem when boolean values are changed on click or other events

          Please clarify which of the above (or what combination of the above) you're seeing. They would have very different causes. In particular, if this field editable, and is editing triggered by click, you may have an unsaved editValue that is being shown instead of the value of the record (see the Grid Editing overview and also listGridField.canToggle).

          Comment


            #20
            Originally posted by Isomorphic
            Can you clarify, are you seeing:

            1. a problem with boolean values returned from the server not rendering properly (we asked for the RPC tab output to troubleshoot this)

            2. a problem where records that have boolean values programmatically set *before any grid interactions have occurred*

            3. only a problem when boolean values are changed on click or other events

            Please clarify which of the above (or what combination of the above) you're seeing. They would have very different causes. In particular, if this field editable, and is editing triggered by click, you may have an unsaved editValue that is being shown instead of the value of the record (see the Grid Editing overview and also listGridField.canToggle).
            1. No, this ListGridField has no representation in the database, so there is no value being returned from the server in which to initialize this value.

            2. No, we set the value of this ListGridField upon receiving data for the grid by way of onDataArrived callback.

            3. Yes, the ListGridField of type Boolean does not visually show a check, when the value is set to Boolean.TRUE.

            Comment


              #21
              So to clarify #2, you're saying that on DataArrived, before the user has interacted with any records, you provide a boolean value, and this is not displaying property *before* the user clicks on the grid?

              Because we're not able to reproduce that.

              Comment


                #22
                Yes, that is what we are seeing.

                Comment


                  #23
                  OK, time to stop speculating - can you produce a standalone test case showing this behavior in the standard SmartGWT SDK? If the only preconditions are just what you describe, it should be trivially reproducible with small changes to the built-in-ds project.

                  Comment


                    #24
                    SC_SNAPSHOT-2011-01-06/PowerEdition Deployment 2011-01-06
                    GWT 1.7.1
                    IE 7 Dev Console


                    Ok, I've isolated the issue, when I create a new project using
                    Code:
                    <inherits name="com.smartgwtpower.SmartGwtPower"/>
                    In the HTML file, the check box works fine. However, when I switch over to no skins via:
                    Code:
                    <inherits name="com.smartgwtpower.SmartGwtPowerNoScript"/>
                    The check box does not have a check in it.

                    My test case looks like this:
                    Code:
                    public void onModuleLoad() {
                            HLayout layout = new HLayout();  
                            layout.setWidth(300);
                            layout.setHeight(200);
                            layout.setMembersMargin(20);
                    
                            ListGrid grid = new ListGrid();
                    
                            ListGridRecord record1 = new ListGridRecord();
                            record1.setAttribute("one", "1");
                            record1.setAttribute("two", "1");
                            record1.setAttribute("three", "1");
                            record1.setAttribute("zero", true);
                    
                            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("zero", "zero");
                            field0.setType(ListGridFieldType.BOOLEAN);
                            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.setFields(fields);
                            grid.setData(records);
                      
                            layout.addMember(grid);
                      
                            layout.draw();
                    
                    //        RootPanel.get().add(label);
                        }
                    Are check boxes suppose to display a check if your application has been skinned? Because this behavior was working fine with our skinned application prior to the SmartGWT 2.3 release?

                    What is the default full path to the image for a skinned check box check? I assume I'm going to have to provide that same image in our skin?

                    Comment


                      #25
                      So it's clearly your skin then. See ListGrid.booleanTrueImage and booleanFalseImage for the full path.

                      Comment


                        #26
                        So I turned the default skin back on via:
                        Code:
                        <inherits name="com.smartgwtpower.SmartGwtPower"/>
                        And I'm trying to get the path/image via:
                        Code:
                        GWT.log(grid.getBooleanTrueImage(), null);
                        And in the Dev Console I get:
                        Code:
                        [INFO] (Null log message)
                        Our skin/code has not changed during our upgrade process, the underlying behavior of SmartGWT has changed, causing a ListGridField of type Boolean to fail to render when set to Boolean.TRUE.

                        I cannot even get the path to the booleanTrue image when the skin is turned on?

                        I'm simply trying to get our application working on the latest version of SmartGWT. Do I need to provide a Boolean.TRUE image now? Or are check boxes suppose to render TRUE showing a check in the box for applications that are skinned?

                        Again, this was working with a previous release of SmartGWT before we upgraded to 2.3.

                        Comment


                          #27
                          Regular CheckBox widgets are rendering fine in our skinned application. It is only the ListGridField of type Boolean that fails to render properly.

                          Comment


                            #28
                            If LG.booleanTrueImage and LG.booleanFalseImage are not set, the grid pulls the images from CheckboxItem.checkedImage and uncheckedImage. Take a look at those settings in your custom skin.

                            Comment


                              #29
                              Originally posted by Isomorphic
                              So it's clearly your skin then. See ListGrid.booleanTrueImage and booleanFalseImage for the full path.
                              This information would have been helpful earlier in this thread.

                              Comment


                                #30
                                This information would have been helpful earlier in this thread.
                                We couldn't agree more and we wish you had tried this earlier! We raised the possibility 4 days ago, but we don't have your skin, so we couldn't test.

                                Comment

                                Working...
                                X