Hello,
This is my first post on the forum, my english is not so good but I will try to explain my problem.
This is my SmartClient Version: v9.0_2013-07-03/LGPL Development Only.
To summarize, I'm trying to find a way to remove a mask from a TextItem.
I have a SelectItem with some values and when I switch the selected value of this item (with a ChangedHandler), I modify the mask of a TextItem. This works fine until I try to remove the previously setted mask from the TextItem for a value which don't need mask.
In fact, I don't know how to remove the mask. I tried textItem.setMask(null) but it does not work and an Umbrella Exception is thrown :
I found a workaround creating two TextItem: one with a mask, an other one without mask and I play with TextItem visibility depending on the selected value but it is not satisfactory.
Can someone help me ?
Regards,
Pauline
This is my first post on the forum, my english is not so good but I will try to explain my problem.
This is my SmartClient Version: v9.0_2013-07-03/LGPL Development Only.
To summarize, I'm trying to find a way to remove a mask from a TextItem.
I have a SelectItem with some values and when I switch the selected value of this item (with a ChangedHandler), I modify the mask of a TextItem. This works fine until I try to remove the previously setted mask from the TextItem for a value which don't need mask.
In fact, I don't know how to remove the mask. I tried textItem.setMask(null) but it does not work and an Umbrella Exception is thrown :
Code:
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) @com.smartgwt.client.widgets.form.fields.FormItem::setProperty(Ljava/lang/String;Ljava/lang/String;)([string: 'mask', null]): this.mask is null
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.smartgwt.client.widgets.form.fields.FormItem.setProperty(FormItem.java)
at com.smartgwt.client.widgets.form.fields.FormItem.setAttribute(FormItem.java:4392)
at com.smartgwt.client.widgets.form.fields.TextItem.setMask(TextItem.java:478)
at com.francetelecom.client.form.search_consult.device.DeviceIdentifierForm.switchField(DeviceIdentifierForm.java:257)
at com.francetelecom.client.form.search_consult.device.DeviceIdentifierForm$1.onChanged(DeviceIdentifierForm.java:102)
at com.smartgwt.client.widgets.form.fields.events.ChangedEvent.dispatch(ChangedEvent.java:102)
at com.smartgwt.client.widgets.form.fields.events.ChangedEvent.dispatch(ChangedEvent.java:1)
at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
at com.smartgwt.client.core.DataClass.fireEvent(DataClass.java:228) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:662)
Can someone help me ?
Regards,
Pauline