DynamicForm does not have an addField(FormItem field) method.
This is inconsistent with DataSource.addField(DataSourceField field).
I would like to propose adding an addFieldmethod to DynamicForm.
As a workaround I tried the following code:
This code gives the following stack trace:
Any workarounds on how to do this? Thanks.
This is inconsistent with DataSource.addField(DataSourceField field).
I would like to propose adding an addFieldmethod to DynamicForm.
As a workaround I tried the following code:
Code:
DynamicForm form = ... CanvasItem newItem = ... FormItem[] fields = form.getFields(); FormItem[] newFields = new FormItem[fields.length+1]; System.arraycopy(fields, 0, newFields, 0, fields.length); newFields[fields.length] =newItem; form.setFields(newFields);
Code:
[ERROR] Unable to load module entry point class com.acme.Application (see associated exception for details) com.google.gwt.core.client.JavaScriptException: (TypeError): this.form has no properties fileName: http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js lineNumber: 1173 stack: ()@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:1173 ()@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:1411 ([object Object],undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined)@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:1408 ([object Object])@http://localhost:8888/com.acme.Application/sc/modules/ISC_Core.js:302 ([object Object],"CanvasItem")@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:238 ([object Array],null,true,undefined)@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:227 ([object Array])@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:216 ([object Array])@http://localhost:8888/com.acme.Application/sc/modules/ISC_Forms.js:217 ([object Object])@http://localhost:8888/com.acme.Application/sc/modules/ISC_Core.js:324 ("fields",[object Array])@http://localhost:8888/com.acme.Application/sc/modules/ISC_Core.js:322 ("fields",[object Array])@jar:file:/home/najmi/.m2/repository/com/smartgwt/smartgwt/1.0b3-SNAPSHOT/smartgwt-1.0b3-SNAPSHOT.jar!/com/smartgwt/client/widgets/BaseWidget.java:641 gwtOnLoad([object Window],"com.acme.Application","1.5")@:0 gwtOnLoad((function () {alert("Failed to load module com.acme.Application\".\nPlease see the log in the development shell for details.");}),"com.acme.Application","http://localhost:8888/com.acme.Application/")@http://localhost:8888/com.acme.Application/hosted.html?com_wellfleetsoftware_gis_gui_gwt_Application:20 maybeStartModule()@http://localhost:8888/com.acme.Application/com.acme.Application.nocache.js:100 ()@http://localhost:8888/com.acme.Application/com.acme.Application.nocache.js:354 @http://localhost:8888/com.acme.Application/hosted.html?com_acme_Application:39 at com.smartgwt.client.widgets.BaseWidget.setProperty(Native Method) at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:531) at com.smartgwt.client.widgets.form.DynamicForm.setFields(DynamicForm.java:1693)
Comment