JavaScriptException with setEditorType on a FormItem

Hi,

I tried to setEditorType on a FormItem but got JavaScriptException from ISC_DataBinding.js lineNumber: 1752

Uncaught exception escaped : com.google.gwt.core.client.JavaScriptException
(TypeError): _1.editContext is undefined

Is there any extra step to follow to set an editortype on a FormItem?

Thanks.

The editortype is a SelectItem, and the FormItem is a DataSourceTextField.

I’m stucking here. Any idea?

Start with the QuickStart Guide, DataBinding chapter, to see if your usage makes sense. Then, see the FAQ for the information you should post if you need help.

If I add the editortype to the DataSourceTextField itself, it works fine. The problem is if I define a DynamicForm and this DataSourceTextField as one of the form’s field (somehow bind together by DateSource), and use the below statement to get the field as a FormItem:

FormItem item = form.getField(“name”);

And define a SelectItem and use it as editortype:

SelectItem typeEditor = new SelectItem(“editor”);
item.setEditorType(typeEditor);

JavaScript exeception throws.

Is this a valid usage or not?

No, that code doesn’t make sense. Again, take a look at the QuickStart Guide, DataBinding chapter.