Announcement

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

    updateRecordComponent never called

    Hi Isomorphic,

    I have a problem that started to happen after the release of v12.0p_2019-10-30/PowerEdition Deployment (built 2019-10-30) - it's not happening in 2019-10-29!.

    Click image for larger version

Name:	Button-missing.gif
Views:	331
Size:	692.7 KB
ID:	260011

    Button is not recreated after update. Method "updateRecordComponent" is not called at all.
    Unfortunately I was unable to reproduce this problem in built-in-ds.

    But my code looks like:
    Code:
    package com.smartgwt.sample.client;
    
    import com.smartgwt.client.types.GroupStartOpen;
    import com.smartgwt.client.types.RecordComponentPoolingMode;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.grid.GroupValueFunction;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
    import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
    
    public class ListGridCustom extends ListGrid {
        private String buttonField;
        private String categoryGroupByField = "category";
    
        public ListGridCustom() {
            setDataSource("supplyItem");
            setShowRecordComponents(true);
            setShowRecordComponentsByCell(true);
            setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE);
            setPoolComponentsPerColumn(true);
            setRecordComponentHeight(22);
            setCanGroupBy(false);
            setCanReorderFields(true);
            setGroupStartOpen(GroupStartOpen.ALL);
            setSortByGroupFirst(true);
            setAllowFilterExpressions(true);
            setGroupByField(categoryGroupByField);
    
            addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
                @Override
                public void onRecordDoubleClick(RecordDoubleClickEvent event) {
                    // Open window
                    // Update datasource "yyyy". That update changes some values of "supplyItem"
                    // Update response to datasource "yyyy" is returned and it contains related update to "supplyItem".
                }
            });
    
            ListGridField itemNameLGF = new ListGridFieldGroupBy("itemName");
            ListGridField categoryLGF = new ListGridFieldGroupBy(categoryGroupByField);
            // Many fields....
    
            setFields(itemNameLGF, categoryLGF);
    
        }
    
        @Override
        protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
            // Many if-else conditions....
            if (!WidgetUsed.canSeeButton(record))
                return "gray";
            else
                return super.getCellCSSText(record, rowNum, colNum);
        }
    
        @Override
        protected Canvas createRecordComponent(ListGridRecord record, Integer colNum) {
            return updateRecordComponent(record, colNum, null, true);
        }
    
        @Override
        public Canvas updateRecordComponent(ListGridRecord record, Integer colNum, Canvas component, boolean recordChanged) {
            if (record.getIsGroupSummary())
                return null;
    
            String fieldName = this.getFieldName(colNum);
    
            if (buttonField.equals(fieldName) && WidgetUsed.canSeeButton(record)) {
                return new IButton();// ......
            }
    
            // TODO Auto-generated method stub
            return super.updateRecordComponent(record, colNum, component, recordChanged);
        }
    
        private class ListGridFieldGroupBy extends ListGridField {
            public ListGridFieldGroupBy(String name) {
                super(name);
                setGroupValueFunction(new GroupValueFunction() {
                    @Override
                    public Object getGroupValue(Object value, ListGridRecord record, ListGridField field, String fieldName, ListGrid grid) {
                        // Many if-else conditions...
                        return null;
                    }
                });
    
            }
        }
    
    }
    
    class WidgetUsed {
    
        public static boolean canSeeButton(ListGridRecord r) {
            // If-else...
            return true;
        }
    }
    Bug doesn't appear in two cases:
    -If I remove "setGroupValueFunction"
    -If button is visible to all records

    I hope you have enough information to detect the problem.

    Best regards
    Pavo

    #2
    We're not able to reproduce this issue directly, but we do have a question. Does the grid where this occurs have hilites applied to it?

    Comment


      #3
      Yes, it has. Hilites are defined this way:
      Code:
              setHilites(new Hilite[] { new Hilite() {
                  {
                      AdvancedCriteria ac = new AdvancedCriteria(OperatorId.OR,
                              new Criterion[] {
                                      new Criterion("field1", OperatorId.EQUALS, "value1"),
                                      new Criterion("field2", OperatorId.EQUALS, "value2") });
                      setCriteria(ac);
                      setCssText("color:#F00;");
                  }
              } });

      Comment


        #4
        Hi Isomorphic,

        this issue is also happening if hilites are not applied. I can email you my original code if that could help you?

        Best regards
        Pavo

        Comment


          #5
          We'd prefer that you create a standalone test case that can be posted here. If you want to interact directly via email that may require a higher level of support.

          However, the key question for you from post #3 is, with the Oct. 29 build which you say was working, does it stop working (in the same way that you report above) if you remove the hilites? If so, we have a good idea what might be going on and can make an attempt at addressing it directly or at least adding some logging that can capture what we need.

          Comment


            #6
            Hi Isomorphic,

            with the Oct. 29 build it stop working if I remove hilites!
            Please let me know when you make these changes and what are the next steps.

            Best regards
            Pavo

            Comment


              #7
              We've made a fix targeted only at SGWT/SC 12.0p (for now), that we hope will fix your issue. This will be in the nightly builds dated 2019-11-21 and beyond.

              If it doesn't solve it, please capture the "recordComponents" logs at "Debug" level using the Developer Console. Try to supply us only with the logs generated from the UI interaction that fails to update, so we don't have to sift through extraneous logs.

              Comment


                #8
                Hi Isomorphic,

                unfortunately, issue is still happening.

                If you look at the ".gif" in post #1, I get these 4 lines after clicking the "Apply" button.

                Code:
                13:23:01.283:XRP2:DEBUG:recordComponents:LeadlistManagement_inCreation:dataChanged() for row 16 and type 'update' doesn't need to refresh record components
                13:23:01.285:XRP2:DEBUG:recordComponents:LeadlistManagement_inCreation:cleaning up recordComponent:[HLayout ID:isc_ActionHLayout_38]
                13:23:01.287:XRP2:DEBUG:recordComponents:LeadlistManagement_inCreation:cleaning up recordComponent:[IButton ID:isc_AssignLeadButton_15]
                13:23:01.291:XRP2:DEBUG:recordComponents:LeadlistManagement_inCreation:dataChanged running refreshRow(16)
                Best regards
                Pavo

                Comment


                  #9
                  We recently eliminated an extra redraw related to hilites, and it looks like that redraw was masking the underlying issue affecting you. However, isolating the problem without a repro case is difficult, and we don't know whether it's actually a Framework problem or a usage issue in your code. Please go ahead and email the repro app to support if possible.

                  Comment


                    #10
                    Hi Isomorphic,

                    would online access to the application with working Developer Console also help you?

                    Best regards
                    Blama

                    Comment


                      #11
                      That would be more difficult to work with than just having the repro app.

                      Comment


                        #12
                        Do you plan on sending us a test case? You previously asked to do so.

                        Comment


                          #13
                          Hi Isomorphic,

                          for now we solved this with getting rid of setGroupValueFunction(), which seems to be somehow involved in this.
                          I'll ask the OP for a testcase next year.

                          Giving you access to the application with working Developer Console would be pretty easy though.

                          Best regards
                          Blama

                          Comment


                            #14
                            Hi Isomorphic,

                            here is a testcase that comes very close to our app. I have some more loginformation, so maybe you can find out something.

                            BuiltInDS.java
                            Code:
                            package com.smartgwt.sample.client;
                            
                            import com.google.gwt.core.client.EntryPoint;
                            import com.smartgwt.client.core.KeyIdentifier;
                            import com.smartgwt.client.data.AdvancedCriteria;
                            import com.smartgwt.client.types.OperatorId;
                            import com.smartgwt.client.util.Page;
                            import com.smartgwt.client.util.PageKeyHandler;
                            import com.smartgwt.client.util.SC;
                            import com.smartgwt.client.widgets.grid.ListGrid;
                            import com.smartgwt.client.widgets.layout.VLayout;
                            
                            /**
                             * Entry point classes define <code>onModuleLoad()</code>.
                             */
                            public class BuiltInDS implements EntryPoint {
                            
                                /**
                                 * This is the entry point method.
                                 */
                                public void onModuleLoad() {
                            
                                    KeyIdentifier debugKey = new KeyIdentifier();
                                    debugKey.setCtrlKey(true);
                                    debugKey.setKeyName("D");
                            
                                    Page.registerKey(debugKey, new PageKeyHandler() {
                                        @Override
                                        public void execute(String keyName) {
                                            SC.showConsole();
                                        }
                                    });
                            
                                    VLayout v = new VLayout();
                                    v.setWidth100();
                                    v.setHeight100();
                            
                                    ListGrid listGrid = new ListGridCustom();
                                    listGrid.fetchData(new AdvancedCriteria("units", OperatorId.EQUALS, "Ea"));
                                    v.addMember(listGrid);
                                    v.draw();
                            
                                }
                            }
                            UnderlyingGrid.java
                            Code:
                            package com.smartgwt.sample.client;
                            
                            import com.smartgwt.client.data.SortSpecifier;
                            import com.smartgwt.client.types.GroupStartOpen;
                            import com.smartgwt.client.types.RecordComponentPoolingMode;
                            import com.smartgwt.client.types.SortDirection;
                            import com.smartgwt.client.widgets.Canvas;
                            import com.smartgwt.client.widgets.grid.ListGrid;
                            import com.smartgwt.client.widgets.grid.ListGridField;
                            import com.smartgwt.client.widgets.grid.ListGridRecord;
                            
                            public class UnderlyingGrid extends ListGrid {
                            
                                protected ListGridField button = new ListGridField("button") {
                                    {
                                        setShowGridSummary(false);
                                        setShowGroupSummary(false);
                                    }
                                };
                                protected ListGridField category;
                                protected ListGridField itemIDLGF;
                                protected ListGridField description;
                                protected ListGridField actionLGF;
                                protected ListGridField skuLGF;
                                protected ListGridField units;
                            
                                public UnderlyingGrid() {
                                    configure();
                            
                                }
                            
                                @Override
                                protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {
                                    return updateRecordComponent(record, colNum, null, true);
                                }
                            
                                @Override
                                public Canvas updateRecordComponent(ListGridRecord record, Integer colNum, Canvas component, boolean recordChanged) {
                                    if (record.getIsGroupSummary())
                                        return null;
                            
                                    String fieldName = this.getFieldName(colNum);
                                    if (button.getName().equals(fieldName)) {
                                        if (component != null) {
                                            MyListIButton button = (MyListIButton) component;
                                            button.setData(record);
                                            return button;
                                        } else {
                                            return new MyListIButton(record, fieldName, null, UnderlyingGrid.this);
                                        }
                                    } else if (actionLGF.getName().equals(fieldName)) {
                                        if (component != null) {
                                            ActionHLayout button = (ActionHLayout) component;
                                            return button;
                                        } else {
                                            return new ActionHLayout(new ActionImgButton("src/deal.svg"), new ActionImgButton("src/deal.svg"),
                                                    new ActionImgButton("src/deal.svg"));
                                        }
                                    }
                                    return null;
                            
                                }
                            
                                private void configure() {
                                    setDataSource("supplyItem");
                                    setFetchOperation("fetchSupply");
                                    setShowRecordComponents(true);
                                    setShowRecordComponentsByCell(true);
                                    setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE);
                                    setPoolComponentsPerColumn(true);
                                    setRecordComponentHeight(22);
                                    setCanGroupBy(false);
                                    setCanReorderFields(true);
                                    setGroupStartOpen(GroupStartOpen.ALL);
                                    setSortByGroupFirst(true);
                                    setGroupByMaxRecords(10000);
                                    setAllowFilterExpressions(true);
                                    setSort(new SortSpecifier("category", SortDirection.ASCENDING));
                                }
                            
                            }

                            ListGridCustom.java

                            Code:
                            package com.smartgwt.sample.client;
                            
                            import java.util.LinkedHashMap;
                            
                            import com.smartgwt.client.data.Criteria;
                            import com.smartgwt.client.data.DSCallback;
                            import com.smartgwt.client.data.DSRequest;
                            import com.smartgwt.client.data.DSResponse;
                            import com.smartgwt.client.data.DataSource;
                            import com.smartgwt.client.data.Record;
                            import com.smartgwt.client.types.Alignment;
                            import com.smartgwt.client.types.AutoFitWidthApproach;
                            import com.smartgwt.client.types.RecordComponentPoolingMode;
                            import com.smartgwt.client.util.SC;
                            import com.smartgwt.client.widgets.Canvas;
                            import com.smartgwt.client.widgets.IButton;
                            import com.smartgwt.client.widgets.ImgButton;
                            import com.smartgwt.client.widgets.Window;
                            import com.smartgwt.client.widgets.events.ClickEvent;
                            import com.smartgwt.client.widgets.events.ClickHandler;
                            import com.smartgwt.client.widgets.form.DynamicForm;
                            import com.smartgwt.client.widgets.form.ValuesManager;
                            import com.smartgwt.client.widgets.grid.GroupNode;
                            import com.smartgwt.client.widgets.grid.GroupTitleRenderer;
                            import com.smartgwt.client.widgets.grid.GroupValueFunction;
                            import com.smartgwt.client.widgets.grid.ListGrid;
                            import com.smartgwt.client.widgets.grid.ListGridField;
                            import com.smartgwt.client.widgets.grid.ListGridRecord;
                            import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
                            import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
                            import com.smartgwt.client.widgets.layout.HLayout;
                            import com.smartgwt.client.widgets.layout.VLayout;
                            
                            public class ListGridCustom extends UnderlyingGrid {
                            
                                ValuesManager valuesManager = new ValuesManager();
                            
                                public ListGridCustom() {
                                    super();
                                    setAutoFetchData(false);
                                    setHeight100();
                                    setCanGroupBy(false);
                                    setGroupByMaxRecords(10000);
                                    setCanReorderFields(true);
                            
                                    setShowRecordComponents(true);
                                    setShowRecordComponentsByCell(true);
                                    setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE);
                                    setPoolComponentsPerColumn(true);
                                    setRecordComponentHeight(22);
                                    setGroupByField("category");
                            
                                    category = new ListGridFieldGroupBy("category");
                                    category.setHidden(true);
                                    itemIDLGF = new ListGridField("itemID");
                                    description = new ListGridField("description");
                                    actionLGF = new ActionListGridField("action");
                                    skuLGF = new ListGridField("SKU");
                                    units = new ListGridField("units");
                                    setGroupByField(category.getName());
                            
                                    addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
                                        @Override
                                        public void onRecordDoubleClick(RecordDoubleClickEvent event) {
                            
                                            DynamicForm df = new DynamicForm();
                                            df.setDataSource("supplyItem");
                                            valuesManager.setDataSource(DataSource.get("supplyItem"));
                                            valuesManager.addMember(df);
                                            Window w = new Window() {
                                                {
                                                    setWidth("50%");
                                                    setHeight("50%");
                                                    setIsModal(true);
                                                    setShowModalMask(true);
                                                    setModalMaskOpacity(70);
                                                }
                            
                                            };
                                            VLayout layout = new VLayout() {
                                                {
                                                    setWidth("50%");
                                                    setHeight("50%");
                                                }
                                            };
                                            w.centerInPage();
                                            w.addMember(layout);
                                            MyIButton mb = new MyIButton(event.getRecord(), "windowButton", valuesManager, w);
                                            valuesManager.fetchData(new Criteria("itemID", event.getRecord().getAttribute("itemID")));
                                            layout.addMembers(df, mb);
                                            w.draw();
                                        }
                                    });
                            
                                    setFields(button, actionLGF, itemIDLGF, description, category, skuLGF, units);
                            
                                    super.setFieldState(
                                            "[{name:\"button\",autoFitWidth:false,width:125},{name:\"action\",width:75},{name:\"SKU\",width:70},{name:\"itemID\"},{name:\"description\",autoFitWidth:false,width:783},{name:\"category\",visible:false,width:115},{name:\"units\",autoFitWidth:false,width:611}]");
                                    super.setSortState("({fieldName:\"itemID\",sortDir:\"ascending\",sortSpecifiers:[{property:\"itemID\",direction:\"ascending\"}]})");
                            
                                }
                            
                                @Override
                                protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
                                    // Many if-else conditions....
                                    return "color: grey";
                                }
                            
                                @Override
                                protected Canvas createRecordComponent(ListGridRecord record, Integer colNum) {
                                    return updateRecordComponent(record, colNum, null, true);
                                }
                            
                                @Override
                                public Canvas updateRecordComponent(ListGridRecord record, Integer colNum, Canvas component, boolean recordChanged) {
                                    if (record.getIsGroupSummary())
                                        return null;
                            
                                    String fieldName = this.getFieldName(colNum);
                                    if (button.getName().equals(fieldName)) {
                                        if (component != null) {
                                            MyListIButton button = (MyListIButton) component;
                                            button.setData(record);
                                            return button;
                                        } else {
                                            return new MyListIButton(record, fieldName, null, ListGridCustom.this);
                                        }
                                    } else if (actionLGF.getName().equals(fieldName)) {
                                        if (component != null) {
                                            ActionHLayout button = (ActionHLayout) component;
                                            return button;
                                        } else {
                                            return new ActionHLayout(new ActionImgButton("src/deal.svg"), new ActionImgButton("src/deal.svg"),
                                                    new ActionImgButton("src/deal.svg"));
                                        }
                                    }
                                    return null;
                            
                                }
                            
                                private class ListGridFieldGroupBy extends ListGridField {
                                    public ListGridFieldGroupBy(String name) {
                                        super(name);
                                        setCanFilter(false);
                                        setCanEdit(false);
                                        setCanGroupBy(false);
                                        setCanSort(false);
                                        setCanDragResize(false);
                                        setCanAutoFitWidth(false);
                                        setShowGridSummary(false);
                                        setShowGroupSummary(false);
                                        setCanExport(false);
                                        setCanHide(false);
                                        setCanReorder(false);
                                        setShowGridSummary(false);
                                        setShowGroupSummary(false);
                                        setWidth(115);
                                        setDefaultWidth(115);
                                        setMinWidth(115);
                                        setMaxWidth(115);
                                        setValueMap(getLeadstatusValueMap());
                            
                                        setGroupValueFunction(new GroupValueFunction() {
                                            @Override
                                            public Object getGroupValue(Object value, ListGridRecord record, ListGridField field, String fieldName, ListGrid grid) {
                                                if (record.getAttribute("category").equals("Office Paper Products")) {
                                                    return 1;
                                                } else if (record.getAttribute("category").equals("Adding Machine/calculator Roll")) {
                                                    return 2;
                                                } else if (record.getAttribute("category").equals("Pastes and Gum")) {
                                                    return 3;
                                                } else
                                                    return 4;
                                            }
                                        });
                            
                                        setGroupTitleRenderer(new GroupTitleRenderer() {
                            
                                            @Override
                                            public String getGroupTitle(Object groupValue, GroupNode groupNode, ListGridField field, String fieldName, ListGrid grid) {
                                                if ((int) groupValue == 1) {
                                                    return getLeadstatusValueMap().get("office");
                                                } else if ((int) groupValue == 2) {
                                                    return getLeadstatusValueMap().get("machine");
                                                } else if ((int) groupValue == 3) {
                                                    return getLeadstatusValueMap().get("gum");
                                                } else
                                                    return "ELSE";
                                            }
                                        });
                                        setAutoFitWidthApproach(AutoFitWidthApproach.VALUE);
                            
                                    }
                            
                                    public LinkedHashMap<String, String> getLeadstatusValueMap() {
                                        LinkedHashMap<String, String> groupValueTitleMap = new LinkedHashMap<>();
                                        groupValueTitleMap.put("office", "Office Paper Products");
                                        groupValueTitleMap.put("machine", "Adding Machine/calculator Roll");
                                        groupValueTitleMap.put("gum", "Pastes and Gum");
                                        groupValueTitleMap.put("else", "ELSE");
                                        return groupValueTitleMap;
                                    }
                            
                                }
                            
                            }
                            
                            class MyIButton extends IButton {
                                Record r;
                                ValuesManager vm;
                                Window w;
                            
                                MyIButton(Record r, String name, ValuesManager vm, Window w) {
                                    super(name);
                                    this.r = r;
                                    this.vm = vm;
                                    this.w = w;
                                    setHeight(22);
                                    setIconSize(18);
                                    setAlign(Alignment.LEFT);
                                    setWidth(110);
                                    setTitle("button");
                                    setIcon("src/deal.svg");
                                    setIconAlign("right");
                                    addClickHandler(new ClickHandler() {
                            
                                        @Override
                                        public void onClick(ClickEvent event) {
                                            r.setAttribute("scientificName", "southern subspecies: Haliaeetus leucocephalus leuc");
                                            r.setAttribute("fakeField", r.getAttribute("itemID"));
                                            if (vm.validate()) {
                                                DataSource.get("animals").updateData(r, new DSCallback() {
                            
                                                    @Override
                                                    public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                                                        // TODO Auto-generated method stub
                                                        if (w != null) {
                                                            w.destroy();
                                                        }
                                                        MyIButton.this.destroy();
                                                    }
                                                }, new DSRequest() {
                                                    {
                                                        setOperationId("updateDescription");
                                                    }
                                                });
                                            }
                                        }
                                    });
                            
                                }
                            
                                public void setData(Record r) {
                                    this.r = r;
                                }
                            
                            }
                            
                            class MyListIButton extends IButton {
                                Record r;
                            
                                MyListIButton(Record r, String name, Window w, ListGrid lg) {
                                    super(name);
                                    this.r = r;
                                    setHeight(22);
                                    setIconSize(18);
                                    setAlign(Alignment.LEFT);
                                    setWidth(110);
                                    setTitle("button");
                                    addClickHandler(new ClickHandler() {
                            
                                        @Override
                                        public void onClick(ClickEvent event) {
                                            SC.logWarn(lg.getFieldState());
                                            SC.logWarn(lg.getSortState());
                                        }
                                    });
                                }
                            
                                public void setData(Record r) {
                                    this.r = r;
                                }
                            
                            }
                            
                            class ActionListGridField extends ListGridField {
                                public ActionListGridField(String name) {
                                    super(name);
                                    setCanFilter(false);
                                    setCanEdit(false);
                                    setCanGroupBy(false);
                                    setCanSort(false);
                                    setCanDragResize(false);
                                    setCanAutoFitWidth(false);
                                    setShowGridSummary(false);
                                    setShowGroupSummary(false);
                                    setCanExport(false);
                                    setCanHide(false);
                                    setCanReorder(false);
                                    setWidth(75);
                                    setMinWidth(75);
                                    setMaxWidth(75);
                                }
                            
                            }
                            
                            class ActionHLayout extends HLayout {
                            
                                public ActionHLayout(ImgButton... imgButton) {
                                    setHeight(22);
                                    addMembers(imgButton);
                                }
                            }
                            
                            /**
                             * Sets the properties for every {@link ImgButton}
                             */
                            class ActionImgButton extends ImgButton {
                                /**
                                 * @param src
                                 *          type({@link String})
                                 * @param prompt
                                 *          type({@link String})
                                 * @param ClickHandler
                                 *          type({@link ClickHandler})
                                 */
                                public ActionImgButton(String src) {
                                    setShowDown(true);
                                    setShowRollOver(true);
                                    // Temporary
                                    setShowDown(false);
                                    setShowRollOver(false);
                                    setBackgroundColor("green");
                                    setCanHover(true);
                                    setShowFocused(false);
                                    setShowFocusedAsOver(false);
                                    setLayoutAlign(Alignment.CENTER);
                                    setSrc(src);
                                    setHeight(16);
                                    setWidth(16);
                                }
                            }
                            supplyItem.ds.xml

                            Code:
                            <DataSource
                                ID="supplyItem"
                                serverType="sql"
                                tableName="supplyItem"
                                titleField="itemName"
                                testFileName="/examples/shared/ds/test_data/supplyItem2.data.xml"
                            >
                                <fields>
                                    <field name="itemID"      type="sequence" hidden="true"       primaryKey="true"/>
                                    <field name="itemName"    type="text"     title="Item"        length="128"       required="true"/>
                                    <field name="SKU"         type="text"     title="SKU"         length="10"        required="true"/>
                                    <field name="description" type="text"     title="Description" length="2000"/>
                                    <field name="category"    type="text"     title="Category"    length="128"       required="true"  escapeHTML="true" canSave="false" hidden="true"
                                           foreignKey="supplyCategory.categoryName"/>
                                    <field name="units"       type="enum"     title="Units"       length="5">
                                        <valueMap>
                                            <value>Roll</value>
                                            <value>Ea</value>
                                            <value>Pkt</value>
                                            <value>Set</value>
                                            <value>Tube</value>
                                            <value>Pad</value>
                                            <value>Ream</value>
                                            <value>Tin</value>
                                            <value>Bag</value>
                                            <value>Ctn</value>
                                            <value>Box</value>
                                        </valueMap>
                                    </field>
                                    <field name="unitCost"    type="float"    title="Unit Cost"   required="true">
                                        <validators>
                                            <validator type="floatRange" min="0" errorMessage="Please enter a valid (positive) cost"/>
                                            <validator type="floatPrecision" precision="2" errorMessage="The maximum allowed precision is 2"/>
                                        </validators>
                                    </field>
                                    <field name="inStock"   type="boolean"  title="In Stock"/>
                                    <field name="nextShipment"  type="date" title="Next Shipment"/>
                                </fields>
                            <serverObject lookupStyle="new" className="com.smartgwt.sample.server.listener.SupplyItemWorker" />
                                <operationBindings>
                                   <operationBinding operationType="fetch" operationId="fetchSupply" serverMethod="fetchSupply">
                              <!--  <whereClause>category in ('Office Paper Products','Adding Machine/calculator Roll','Pastes and Gum', 'Indices For Files','Office Machines and Electronics') AND($defaultWhereClause)</whereClause> -->
                                   </operationBinding>
                                   <operationBinding operationType="update" />
                                </operationBindings>
                            </DataSource>
                            animals.ds.xml

                            Code:
                            <DataSource
                                ID="animals"
                                serverType="sql"
                                tableName="animals"
                                testFileName="animals.data.xml"
                            >
                                <fields>
                                    <field name="commonName"      title="Animal"             type="text"/>
                                    <field name="scientificName"  title="Scientific Name"    type="text"  primaryKey="true"  required="true"/>
                                    <field name="lifeSpan"        title="Life Span"          type="integer"/>
                                    <field name="status"          title="Endangered Status"  type="text">
                                        <valueMap>
                                            <value>Threatened</value>
                                            <value>Endangered</value>
                                            <value>Not Endangered</value>
                                            <value>Not currently listed</value>
                                            <value>May become threatened</value>
                                            <value>Protected</value>
                                        </valueMap>
                                    </field>
                                    <field name="diet"            title="Diet"               type="text"/>
                                    <field name="information"     title="Interesting Facts"  type="text"  length="1000"/>
                                    <field name="picture"         title="Picture"            type="image" detail="true"
                                           imageURLPrefix="/isomorphic/system/reference/inlineExamples/tiles/images/"/>
                                           <field name="fakeField"  customSelectExpression =""/>
                            
                                </fields>
                                  <serverObject lookupStyle="new" className="com.smartgwt.sample.server.listener.AnimalsWorker" />
                                <operationBindings>
                                   <operationBinding operationType="update" operationId="updateDescription" serverMethod="updateDescription" />
                                </operationBindings>
                            </DataSource>
                            AnimalsWorker.java

                            Code:
                            package com.smartgwt.sample.server.listener;
                            
                            import java.util.HashMap;
                            import java.util.Map;
                            
                            import javax.servlet.http.HttpServletRequest;
                            
                            import com.isomorphic.criteria.DefaultOperators;
                            import com.isomorphic.criteria.criterion.SimpleCriterion;
                            import com.isomorphic.datasource.DSRequest;
                            import com.isomorphic.datasource.DSResponse;
                            import com.isomorphic.datasource.DataSource;
                            
                            public class AnimalsWorker {
                            
                                static int count;
                            
                                public DSResponse updateDescription(DSRequest request, HttpServletRequest servletRequest) throws Exception {
                                    Map&lt;String, Object&gt; m = new HashMap&lt;&gt;();
                            
                                    m.put("description", "description" + ++count);
                                    DSRequest dsrerSup = new DSRequest("supplyItem", DataSource.OP_UPDATE, request.getRPCManager());
                                    dsrerSup.addToCriteria(new SimpleCriterion("itemID", DefaultOperators.Equals, request.getValues().get("fakeField")));
                                    dsrerSup.setValues(m);
                                    DSResponse dsr = dsrerSup.execute();
                                    if (dsr.statusIsSuccess()) {
                            
                                        DSRequest dsreq = new DSRequest("supplyItem", DataSource.OP_FETCH, request.getRPCManager());
                                        dsreq.setOperationId("fetchOperation");
                                        dsreq.addToCriteria(new SimpleCriterion("itemID", DefaultOperators.Equals, request.getValues().get("fakeField")));
                                        DSResponse dsr2 = dsreq.execute();
                                        dsr.addRelatedUpdate(dsr2.setOperationType(DataSource.OP_UPDATE));
                                        return dsr;
                                    }
                                    return dsr.setFailure("Problems");
                            
                                }
                            }
                            SupplyItemWorker.java

                            Code:
                            package com.smartgwt.sample.server.listener;
                            
                            import javax.servlet.http.HttpServletRequest;
                            
                            import com.isomorphic.datasource.DSRequest;
                            import com.isomorphic.datasource.DSResponse;
                            
                            public class SupplyItemWorker {
                            
                                public DSResponse fetchSupply(DSRequest request, HttpServletRequest servletRequest) throws Exception {
                                    return request.execute();
                            
                                }
                            }
                            Its more or less like the code in our application, but I was not able to trigger the behavior OP was mentioning, so maybe You can use it for further investigation.

                            Some more Information:

                            When the problem occurs, I get those logs from the DeveloperConsole:


                            13:18:57.257:XRP3:DEBUG:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):dataSource data changed firing
                            13:18:57.259:XRP3:INFO:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):updating cache in place after operationType: update, allMatchingRowsCached true
                            13:18:57.262:XRP3:INFO:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):Updating cache: operationType 'update' (no componentID) ,1 rows update data:
                            [
                            {
                            lots of fields...
                            }
                            ]
                            13:18:57.264:XRP3:DEBUG:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):updated cache: 0 row(s) added, 1 row(s) updated, 0 row(s) removed.
                            13:18:57.265:XRP3:INFO:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):doSort: sorting on properties [CUST_NAME_CONTACTPERSFULLNAME] : directions [true] : full cache allows local sort


                            When the problem doesn't occure, I get those outputs from the DeveloperConole:

                            12:59:20.498:XRP9:DEBUG:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):dataSource data changed firing
                            12:59:20.500:XRP9:INFO:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):updating cache in place after operationType: update, allMatchingRowsCached true
                            12:59:20.501:XRP9:INFO:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):Updating cache: operationType 'update' (no componentID) ,1 rows update data:
                            [
                            {
                            lots of fields...
                            }
                            ]
                            12:59:20.504:XRP9:DEBUG:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):updated cache: 0 row(s) added, 1 row(s) updated, 0 row(s) removed.
                            12:59:20.504:XRP9:INFO:ResultSet:isc_ResultSet_1 (dataSource: OUR_DATASOURCE, created by: LeadlistManagement_picked):doSort: sorting on properties [CUST_NAME_CONTACTPERSFULLNAME] : directions [true] : full cache allows local sort
                            12:59:20.720:TMR3:DEBUG:layout:isc_HLayout_24:centering wrt visible breadth: 22
                            12:59:20.725:TMR3:INFO:layout:isc_HLayout_24:layoutChildren (reason: initial draw):
                            layout specified size: 27w x 22h
                            drawn size: 27w x 22h
                            available size: 27w (length) x 22h
                            [ImgButton ID:isc_ActionHLayout_ActionImgButton_65]
                            16 drawn length (resizeLength: 16) (policyLength: 16) (explicit size)
                            16 drawn breadth (explicit size)
                            [Label ID:isc_Label_21]
                            undefined drawn length (policyLength: 0) (hidden)
                            undefined drawn breadth (undefined)

                            12:59:20.730:TMR3:DEBUG:layout:isc_ActionHLayout_21:centering wrt visible breadth: 22
                            12:59:20.733:TMR3:INFO:layout:isc_ActionHLayout_21:layoutChildren (reason: initial draw):
                            layout specified size: 65w x 22h
                            drawn size: 65w x 22h
                            available size: 65w (length) x 22h
                            [ImgButton ID:isc_ActionHLayout_ActionImgButton_63]
                            16 drawn length (resizeLength: 16) (policyLength: 16) (explicit size)
                            16 drawn breadth (explicit size)
                            [ImgButton ID:isc_ActionHLayout_ActionImgButton_64]
                            16 drawn length (resizeLength: 16) (policyLength: 16) (explicit size)
                            16 drawn breadth (explicit size)
                            [HLayout ID:isc_HLayout_24]
                            27 drawn length (resizeLength: 27) (policyLength: *) (no length specified)
                            22 drawn breadth (breadth policy: fill)


                            As you can see, in the case it appears the information about layout is not present. But You know best whats happening in between..

                            I also found a way to get rid of the bug, but I have no clue why. What I did was removing the setValueMap(...) method from the ListGridFieldGroupBy(see ListGridCustom.java). In our ds.xml this field has no valueMap defined.

                            Maybe that may trigger something on Your site.

                            Hopefully You can help us here out, because we really need the setGroupValueFunction. Any information could be helpful to figure this one out.

                            Thanks in advance,
                            Kind Regards










                            Comment


                              #15
                              We know from the initial analysis that when the problem happens, the component (and row) don't get refreshed, so it would make sense that in that case there are no logs from the component being redrawn (or from its layout). So, we thank you for the effort, but it doesn't help us isolate the cause.

                              What we really need is a test case with which we can reproduce the problem.

                              Comment

                              Working...
                              X