Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TextItem with setReadOnlyDisplay 'static' generates warnings when canEdit = false

    SmartGWT 4.1d LGPL 2013-11-07

    When I have text fields that turn into static text items when can edit = false, SmartGWT generates warnings.
    Everything does work OK, but these warnings could be a minor internal bug.

    Simple (not complete) code:
    Code:
    TextItem editableName = new TextItem("editableName");
    editableName.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
    editableName.addClickHandler(clickHandler);  //defined earlier
    editableName.addKeyPressHandler(kpHandler);  //defined earlier
    
    //later, in an event handler unrelated to the form item, when some data arrives
    editableName.setValue("data from elsewhere");
    editableName.setCanEdit(false);

    11:34:09.782 [ERROR] [cloudview1] 11:34:09.781:TMR0:WARN:TextItem:isc_TextItem_4[itemName]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
    com.smartgwt.client.core.JsObject$SGWT_WARN: 11:34:09.781:TMR0:WARN:TextItem:isc_TextItem_4[itemName]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    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: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:724)

    #2
    Let us know if you get this in a true standalone test case in the latest nightly build.

    Comment


      #3
      Still seeing this in 4.1p

      Hi team,

      Confirmed this warning still appears in 4.1p 2014-05-07.

      Simple test case:
      Code:
      TextItem field = new TextItem("test");
      field.setCanEdit(false);
      field.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
      field.setValue("test");

      Comment


        #4
        Again, try creating a true standalone test case, and test it in the stock SDK, not your application (where many non-default settings may exist).

        Also, since STATIC display does not allow focus by default, this warning would be expected if you attempting to attach a keyPress handler to an item that can never receive keyboard focus.

        Comment


          #5
          Standalone test case

          Ok here is that standalone test case you asked for. I'm on 4.1p 2014-06-19.

          Code:
          package standalone.client;
          
          import com.google.gwt.core.client.EntryPoint;
          import com.smartgwt.client.widgets.form.DynamicForm;
          import com.smartgwt.client.widgets.form.fields.TextItem;
          import com.smartgwt.client.types.ReadOnlyDisplayAppearance;
          
          
          public class TestCase implements EntryPoint 
          {
          	public void onModuleLoad() 
          	{
          		DynamicForm test = new DynamicForm();
          		
          		TextItem field = new TextItem("test");
          		field.setCanEdit(false);
          		field.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
          		field.setValue("test");
          		
          		test.setItems(field);
          		
          		test.draw();
          	}
          }
          Dev Mode Console Output:
          Code:
          00:00:20.528 [ERROR] 12:48:23.658:WARN:TextItem:isc_TextItem_1[test]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element
          com.smartgwt.client.core.JsObject$SGWT_WARN: 12:48:23.658:WARN:TextItem:isc_TextItem_1[test]:Attempting to apply event handlers to this item. Unable to get a pointer to this item's focus element 
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 	
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 	
          at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 	
          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: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:576) 	
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:304) 
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) 	
          at com.smartgwt.client.widgets.BaseWidget.draw(BaseWidget.java) 
          at standalone.client.TestCase.onModuleLoad(TestCase.java:22) 	
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 	
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
          at java.lang.reflect.Method.invoke(Method.java:606) 	
          at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411) 
          at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) 	
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) 	
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) 	
          at java.lang.Thread.run(Thread.java:745)

          Comment


            #6
            Do you need that test case packed into an Eclipse app?

            Was that test case good enough? It's my first test case attempt. I ran it in dev mode using the local jetty instance.

            Comment


              #7
              We haven't looked into it yet - it's in the queue and assigned to be looked at, but is naturally behind issues from customers with support contracts.

              We'll update here once we have more information for you.

              Comment


                #8
                No problem. Some day hoping to be one of those paying customers. :)

                Comment


                  #9
                  This has been fixed for builds of 4.1 and 5.0 dated June 30 and later.

                  Comment


                    #10
                    Nice, thanks!

                    Comment

                    Working...
                    X