Announcement

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

    Strange behaviour of IntegerItem and getValueAsInteger

    Hello,

    I am using SmartClient/SmartGWT Framework (SNAPSHOT_v9.1d_2013-12-30/Pro Deployment 2013-12-30).

    I set the value of an IntegerItem.
    Then, I want to assign the current value of the IntegerItem by means of getValueAsInteger to an Integer-object.
    But during execution of getValueAsInteger an exception occurs:

    Caused by: com.google.gwt.dev.shell.HostedModeException: invoke arguments: JS value of type string, expected int
    at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:65)
    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.smartgwt.client.widgets.form.fields.IntegerItem.getValueAsInteger(IntegerItem.java)

    What am I doing wrong?
    Andreas

    #2
    Same issue in 4.1p 2014-05-14

    Simple steps to reproduce (I hope this can suffice in lieu of a test case - strapped for time)

    Create an IntegerItem (add it to a form).
    Type a number in the IntegerItem field (don't call setValue in code).
    Call getValueAsInteger against the IntegerItem to obtain the value that was typed in.

    Comment


      #3
      Sorry no, this will not be looked into without a test case.

      Comment


        #4
        Sorry wish I had time but it's a pretty nasty bug that the value is coming through as a String when calling the get as integer method. The test case would be very easy for you to produce.

        Comment


          #5
          Or, we could get a "not reproducible" result as we usually do when there is no test case.

          Comment


            #6
            Fair enough, but I think this one is pretty cut and dry if you try those steps as I've written them (manually enter an integer into the IntegerItem field without calling setValue, then make a call to getValueAsInteger).

            If isn't reproducible let me know and I'll make time in my off hours to figure out how to do standalone test cases and send one to you.

            Comment


              #7
              Fixed!

              Hi guys. I'm on 4.1p 2014-05-19 and am now seeing it arrive as an Integer.

              Comment

              Working...
              X