Since I started Using 2.1 releases, I am getting many “WARN” messages in the “Development Mode” tab.
I would like to clean up my code so that GWT would not generate these warning messages. any FAQ, or references, whatever to help me with these warnings?
No. Just read the individual warnings, see if you understand them and try to correct them that way. If you don’t, search the docs and forums for the warning message to see if it’s already been covered. Finally, post about any warnings that seem to be unique to you and which you don’t understand.
what is causing this error? If I clink somewhere on the VLayout(canvas) the TextItem loses focus, and clicking in the text area does NOT set the focus.
It’s not clear from the code you provided (we can’t run it - it depends on other code you’ve written). If you can show runnable code that produces the error, we can take a look.
I have seen this also and can replicate it to the following code. The focus is applied correctly to the TextItem in all these browsers (Chrome, IE 7, and FF). Using SmartGWT 2.1 and GWT 2.0.0. But the Warning still appears from the setAutoFocus(true); line.
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.TextItem;
public class FocusTest implements EntryPoint{
public void onModuleLoad() {
TextItem textField = new TextItem();
textField = new TextItem();
textField.setTitle("label");
DynamicForm form = new DynamicForm();
form.setFields(textField);
form.setAutoFocus(true);
form.draw();
}
}
The following is the complete development mode console log:
10:57:22.843 [ERROR] [w2client] 10:57:22.840:WARN:DynamicForm:isc_OID_2:couldn’t find focus item: undefined
com.smartgwt.client.core.JsObject$SGWT_WARN: 10:57:22.840:WARN:DynamicForm:isc_OID_2:couldn’t find focus item: undefined
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java)
at gov.state.wraps.client.root.client.prototype.FocusTest.onModuleLoad(FocusTest.java:17)
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.ModuleSpace.onLoad(ModuleSpace.java:369)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)