possible setEditorType() bug in DatasourceField

Hi,

When calling the DatasourceField.setEditorType(), it is not proper being applied to the ListGrid and DynamicForm fields that are bind to the DataSource field.

This issue just happens when setting a FormItem that has some custom properties (like some added event handlers) as the editor type of the DatasourceField. The type of the editor is being applied but the customized actions are not being applied to the ListGridField.

Looking at the SmartGwt code (release 1.1), I checked that the ListGridField.setEditorType does the following:

        setAttribute("editorType", editorType.getType());
        JavaScriptObject editorConfig = editorType.getConfig();
        setAttribute("editorProperties", editorConfig);

while the DataSourceField.setEditorType, only does:

        setAttribute("editorType", editorType.getType());

So, isn’t the DomainDataSource.setEditorType() missing the “editorProperties” attribute to be set?

If i manually set the “editorProperties” of the DataSourceField, then all editor properties are being propagated to the ListGridField, and when editing the record on the Grid, it works fine (i.e., it considers the handlers)

...
            v_dataSourceField.setEditorType(v_editorType);
            JavaScriptObject v_editorConfig = v_editorType.getConfig();
            v_dataSourceField.setAttribute("editorProperties", v_ditorConfig);
...

Is this really a BUG or I have to do something else to get the ListGrid proper using the DataSource defined EditorTypes?

Regards,
Cerávolo

This change is already in SVN.

Ops, sorry for not checking the latest SVN revision to see if it was already fixed. I looked in the 1.1 released source code only.

Also, I checked the FormItem.setEditorType() (in the latest revision!) and it doesn’t set the “editorProperties” attribute either.

I didn’t made a test here, but I think it should set the “editorProperties” too, didn’t it? Because if someone directly call the FormItem.setEditorType(), instead of the one in DataSourceField, it will probably not work either.

Well, thanks for fixing the DataSourceField anyway!

Best Regards,
Cerávolo