Hello,
I've created a custom widget, then a custom form item which extends CanvasItem and in the constructor I call setCanvas() with my custom widget.
When adding this as editorType in a DataSource, the widget isn't added in the form.
I've tested the same thing with a framework widget, and it's not showing either. Here, I expected "blablabla" to be shown in the "custom" column:
As a test, I've added the HTMLFlow on the canvas itself and there it is shown as expected. But why is it not when the form is drawn?
I've tested it too with TextItem & TextAreaItem instead of a CanvasItem and those are OK. For FloatItem, I get an exception so there might be still something wrong with setEditorType().
version:
SmartGWT rev 627
thanks
I've created a custom widget, then a custom form item which extends CanvasItem and in the constructor I call setCanvas() with my custom widget.
When adding this as editorType in a DataSource, the widget isn't added in the form.
I've tested the same thing with a framework widget, and it's not showing either. Here, I expected "blablabla" to be shown in the "custom" column:
Code:
VLayout canvas = new VLayout();
canvas.setShowEdges(true);
DataSource ds = new DataSource();
DataSourceField field = new DataSourceField("text", FieldType.TEXT);
ds.addField(field);
field = new DataSourceField();
HTMLFlow flow = new HTMLFlow();
flow.setContents("blablabla");
CanvasItem canvasItem = new CanvasItem();
canvasItem.setCanvas(flow);
field.setEditorType(canvasItem);
field.setName("custom");
ds.addField(field);
DynamicForm form = new DynamicForm();
form.setDataSource(ds);
canvas.addMember(form);
canvas.addMember(flow); //add to canvas to check if it really shows something
As a test, I've added the HTMLFlow on the canvas itself and there it is shown as expected. But why is it not when the form is drawn?
I've tested it too with TextItem & TextAreaItem instead of a CanvasItem and those are OK. For FloatItem, I get an exception so there might be still something wrong with setEditorType().
version:
SmartGWT rev 627
thanks
Comment