Unnecessary widget drawn when Record Component used

We wanted to use Checkboxes as radio button and felt that overriding our Listgrid with createRecordComponent as shown below was a best approach but what we see is two widgets in each cell that we added a Record component.(One is the ImgButton that we created on createRecordComponent and another one is ‘img’ object coming from ‘skins/EnterpriseBlue/images/DynamicForm/[un]checked_Disabled.png’ )

The other issue that we see is when we freeze another (arbitrary column) the widget that was created using record component gets hidden and the other one is disabled.
Any help would be highly appreciated.
PS. Using 2.5 of smartgwt and 8.1 of SmartClient.
Thanks,

Attached you will find the screen shot as well as all my test scenarios.

...
 testGrid = new ListGrid() {
                @Override
                protected Canvas createRecordComponent(final ListGridRecord record, java.lang.Integer colNum) {

                    final String fieldName = this.getFieldName(colNum);
                    if (fieldName.equals("A") || fieldName.equals("B") || fieldName.equals("C")) {

                        final ImgButton button = new ImgButton();
                        button.setHeight(11);
                        button.setWidth(11);
                        button.setShowRollOver(false);
                        button.setShowRollOverIcon(false);
                        button.setSrc("../images/silk/check.png");
                        button.setActionType(SelectionType.RADIO);
                        button.setRadioGroup("rentra" + record.getAttribute("pk"));
                        button.setSelected(record.getAttributeAsBoolean(fieldName));
                        button.addClickHandler(new ClickHandler() {
                            public void onClick(ClickEvent event) {
                                SC.say("Clicked : " + fieldName);
                            }
                        });
                        return button;

                    } else {
                        return null;
                    }
                }

            };
...
 testGrid.setAutoFetchData(true);
            testGrid.setRecordComponentPoolingMode(RecordComponentPoolingMode.DATA);
            testGrid.setRecordComponentPosition(EmbeddedPosition.WITHIN);
            testGrid.setShowRecordComponents(true);
            testGrid.setRecordComponentHeight(12);
            testGrid.setShowRecordComponentsByCell(true);
            testGrid.setEditEvent(ListGridEditEvent.CLICK);
            testGrid.setDataSource(testDS);

RecordComponents.jpg

GwtTest.java (3.68 KB)

GwtTestXmlDS.java (2.01 KB)

GwtTest.html (2.5 KB)

gwttest.data.xml (599 Bytes)

What you’re seeing is the default rendering for the field, with your recordComponent on top. This is not a good use case for recordComponents, just add CellClickHandlers for the field to create the mutex behavior you want. Or, enable the “checkbox” selectionAppearance and set single selection.

Thanks for the quick response. Our Use case is much more complex than the sample I put out. We needed to have the radio button behavior with single click. With the options you provided, we had to click twice. The first time, to set focus on the record (row) and second click to check or un-check the field.
It would be nice to override the ‘default rendering’ for the field.
Thanks,
Dawit

No, with the option we provided there is no need to click twice.

Providing a CellFormatter allows you to override the default rendering for a field.