Hi,
When clicking FormItemIcon to clear item value I get java script error:
The test case is simple enough:
Tested on SGWT nightly 2011-03-15. No messages on the Developer Console. Firefox 3.6; Gentoo Linux; Development/Debug mode.
MichalG
When clicking FormItemIcon to clear item value I get java script error:
Code:
Uncaught exception escaped : com.google.gwt.core.client.JavaScriptException (TypeError): self.clearValue is not a function fileName: http://localhost:8080 lineNumber: 85 stack: ()@http://localhost:8080:85 @:0 ([object GWTJavaObject],4980790,[object GWTJavaObject])@http://localhost:8080/TestFilterImageItem/hosted.html?org_yournamehere_Main:56 ([object Object],[object Object],[object Object])@http://localhost:8080:8 ((function () {var param = {form: arguments[0], item: arguments[1], icon: arguments[2]};var event = __gwt_makeJavaInvoke(1)(null, 7340061, param);__gwt_makeJavaInvoke(1)(selfJ, 4980790, event);}),[object Object],[object Object])@http://localhost:8080:72 @:0 (null,65563,(function () {var param = {form: arguments[0], item: arguments[1], icon: arguments[2]};var event = __gwt_makeJavaInvoke(1)(null, 7340061, param);__gwt_makeJavaInvoke(1)(selfJ, 4980790, event);}),[object Object],[object Object])@http://localhost:8080/TestFilterImageItem/hosted.html?org_yournamehere_Main:56 ([object Object],[object Object],[object Object])@http://localhost:8080:42 isc_FormItem__iconClick("_0")@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Forms.js:1406 isc_DynamicForm_handleClick([object Object],(void 0))@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Forms.js:643 isc_c_EventHandler_bubbleEvent([object Object],"click")@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Core.js:1515 isc_c_EventHandler_handleClick([object Object])@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Core.js:1363 isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Core.js:1350 isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Core.js:1341 isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Core.js:1578 anonymous([object MouseEvent])@http://localhost:8080/TestFilterImageItem/sc/modules/ISC_Core.js:38 See the Development console log for details. Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.
Code:
package org.yournamehere.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.widgets.form.FilterBuilder; import com.smartgwt.client.widgets.form.fields.FormItemIcon; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler; import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent; import com.smartgwt.client.widgets.layout.VLayout; public class MainEntryPoint implements EntryPoint { public MainEntryPoint() { } public void onModuleLoad() { DataSource ds = new DataSource(); DataSourceTextField textField = new DataSourceTextField("text"); ds.setFields(textField); FilterBuilder filter = new FilterBuilder(); final TextItem item = new TextItem(); FormItemIcon clearIcon = new FormItemIcon(); clearIcon.setSrc("[SKIN]/actions/remove.png"); clearIcon.addFormItemClickHandler(new FormItemClickHandler() { public void onFormItemClick(FormItemIconClickEvent event) { item.clearValue(); } }); item.setIcons(clearIcon); textField.setEditorType(item); filter.setDataSource(ds); VLayout main = new VLayout(); main.addMember(filter); main.draw(); } }
MichalG
Comment