I am using smartGwt version:
v8.3p_2012-11-24/LGPL Development Only (built 2012-11-24)
I have a DynamicForm that contains several CanvasItems. The CanvasItems hold different elements that are created and removed dynamicaly.
When I run the following code and click on the generated button, the new canvasItem is created, but when I click on the SelectItem drop down arrow I get an exception:
[ERROR] [gwttest] 14:22:11.303:IFCS8:WARN:Log:TypeError: this.form is null
After this exception the drop down field is not displayed. only after clicking it again it is displayed.
It looks like the previous CanvasItem is not destroyed and it catches the click event.
v8.3p_2012-11-24/LGPL Development Only (built 2012-11-24)
I have a DynamicForm that contains several CanvasItems. The CanvasItems hold different elements that are created and removed dynamicaly.
When I run the following code and click on the generated button, the new canvasItem is created, but when I click on the SelectItem drop down arrow I get an exception:
[ERROR] [gwttest] 14:22:11.303:IFCS8:WARN:Log:TypeError: this.form is null
Code:
import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.layout.VLayout; public class GwtTest implements EntryPoint { private CanvasItem mComboCanvasItem; private SelectItem mCombo; private DynamicForm mComboDynamicForm; private DynamicForm mDynamicForm; private VLayout mAppletPanel; public void onModuleLoad() { mAppletPanel = new VLayout(); mAppletPanel.draw(); mComboCanvasItem = new CanvasItem(); mComboCanvasItem.setShowTitle(false); mCombo = new SelectItem(); mCombo.setShowTitle(false); mCombo.setValueMap("aaa","bbb"); mComboDynamicForm = new DynamicForm(); mComboDynamicForm.setFields(mCombo); mComboCanvasItem.setCanvas(mComboDynamicForm); mDynamicForm = new DynamicForm(); mDynamicForm.setFields(mComboCanvasItem); mAppletPanel.addMember(mDynamicForm ); Button replaceFieldButton = new Button("replace fields"); replaceFieldButton.addClickHandler(new ClickHandler() { @Override public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) { mComboCanvasItem = new CanvasItem(); mComboCanvasItem.setCanvas(mComboDynamicForm); mComboCanvasItem.setShowTitle(false); mDynamicForm.setFields(mComboCanvasItem); mDynamicForm .redraw(); mComboCanvasItem.setCanvas(mComboDynamicForm); mDynamicForm .redraw(); mCombo.setValueMap("baaa","dbbb"); } }); mAppletPanel.addMember(replaceFieldButton); } } }
It looks like the previous CanvasItem is not destroyed and it catches the click event.
Comment