ListGrid.createRecordComponent not called unless a column is sorted

This still seems broken in the latest nightly build.

My override of ListGrid.createRecordComponent is not called when my ListGrid.updateData finishes. I have to do two things to cause it to be called:

  1. I have to call ListGrid.refreshFields();
  2. I have to make sure one of the columns is sorted.

Is this a known issue?

Thanks,

Jim

Always post a standalone testcase when you claim to have found a bug.

Ok, I was initially hoping to find out whether it was a known issue or not.

In distilling it down to a very simple case, matters got worse. In this sample, I can’t even cause ListGrid.updateRecordComponent to be called by refreshing the list fields. Anyway, Using this sample, edit a username, press enter, and note that the text on the canvas in the first column is not updated. Sort a column, and notice it gets updated.

import com.google.gwt.core.client.EntryPoint;
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 Test implements EntryPoint {  
    
    @Override
    public void onModuleLoad() {
        Canvas canvas = new Canvas();              
        
        final ListGrid myList = new ListGrid() {
            protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {
                if (this.getFieldName(colNum).equals("abc")) {
                    Canvas c = new Canvas();
                    c.setContents(record.getAttributeAsString("userName"));                    
                    return c;
                }
                return null;
            }
            
            @Override
            public Canvas updateRecordComponent(ListGridRecord record, Integer colNum, Canvas component, boolean recordChanged) {
                if (this.getFieldName(colNum).equals("abc")) {
                    Canvas c = component;
                    c.setContents(record.getAttributeAsString("userName"));                    
                    return c;
                }
                return component;
            }
        };
        
        myList.setCanEdit(true);
        myList.setShowRecordComponents(true);
        myList.setShowRecordComponentsByCell(true);
        myList.setHeight(300);
        myList.setShowAllRecords(true);
        ListGridField widgetField = new ListGridField("abc", "Some Widget");
        widgetField.setCanEdit(false);
        ListGridField nameField = new ListGridField("userName", "Name");
        myList.setFields(new ListGridField[] {widgetField, nameField});
        ListGridRecord joe = new ListGridRecord();
        joe.setAttribute("userName", "joe");
        ListGridRecord frank = new ListGridRecord();
        frank.setAttribute("userName", "frank");
        ListGridRecord bob = new ListGridRecord();
        bob.setAttribute("userName", "bob");
        myList.setData(new ListGridRecord[] {joe, frank, bob});
        
        canvas.addChild(myList);
        canvas.draw();
    }

}

I’m having the same issue, has this been reported as an issue?
The workaround is to set the sort field (setSortField) on the grid

I am also having the same problem.

Like others suggested sorting fixes the problem but when we are implementing sort on listGrid columns then the updateRecordComponent is calling unnecessarily giving unpleasant placement of recordComponents.

Can anyone has better solution to the above problem?

Thanks

Any suggestions to the above problem? I am using the smartGWT 2.3 version.

I have same problem.