Announcement

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

    How to set value for MiniDateRangeItem

    Hi,

    I try to set the value for MiniDateRangeItem from code as follows:

    MiniDateRangeItem mdri = new MiniDateRangeItem();
    DateRange = new DateRange();
    dateRange.setRelativeStartDate(new RelativeDate("-1200m"));
    dateRange.setRelativeEndDate(new RelativeDate("-1000m"));
    mdri.setValue(dateRange);

    But the value is not getting displayed in the field.

    Thanks,
    Ramya

    #2
    You haven't posted a version, and the test case is incomplete.

    If you think there's a framework bug here:

    1. test with the latest version (see smartclient.com/builds) and report the version when you post

    2. post a complete test case, not just a code snippet.

    Comment


      #3
      How to set value for MiniDateRangeItem

      Hi,

      I'm using 5.0 version smartgwt..

      I try to set value for MiniDateRangeItem as found in the attached code..

      I could not get the value displayed in form field..
      Attached Files
      Last edited by ramyaraj; 15 Apr 2015, 02:56.

      Comment


        #4
        Please re-read:

        1. test with the latest version (see smartclient.com/builds) and report the version when you post
        "5.0" is not the complete version. See SmartClient.com/builds and/or the FAQ.

        Comment


          #5
          Hi,

          Tested with the following versions:

          smartclient.com/builds/SmartGWT/5.1d/LGPL/2015-04-15 and
          smartclient.com/builds/SmartGWT/5.0p/LGPL/2015-04-15

          still the MiniDateRangeItem field is not displaying the value set through the code. ( attached code )
          Attached Files

          Comment


            #6
            Don't use RootPanel, use draw() (see QuickStart Guide).

            We'll take a look regardless.

            Note that it's likely that if there is a framework issue here, changing the order of calls would probably fix it:

            1. calling getItem() to retrieve the MiniDateRangeItem *after* you have called setItems()

            2. call setValue() on the returned MiniDateRangeItem passing the DateRange object

            Comment


              #7
              Hi,

              Tried on your suggestion:

              1. calling getItem() to retrieve the MiniDateRangeItem *after* you have called setItems()

              2. call setValue() on the returned MiniDateRangeItem passing the DateRange object

              Attached the code.. Still the problem is not resolved..

              Also I need to set value into the form using Map that contains dateRange.. Is there any possibility of doing that!

              Thanks,
              Ramya
              Attached Files

              Comment


                #8
                We've made some changes, available in tomorrow's patch build (dated April 20th) that should resolve your original test case.

                Even without these changes, we show code like your second test case working.

                For both scenarios, please try the new build and let us know if you still have issues.

                Comment


                  #9
                  Hi,

                  I have tried with the new build jars from:
                  http://www.smartclient.com/builds/Sm...GPL/2015-04-22 and
                  http://www.smartclient.com/builds/Sm...GPL/2015-04-22

                  for the testcase attached..

                  In both cases, I get the following exception:

                  [ERROR] [testminidaterangeitem] Unable to load module entry point class com.test.miniDateRange.client.TestMiniDateRangeItem (see associated exception for details)
                  java.lang.ClassCastException: com.smartgwt.client.data.DateRange cannot be cast to com.smartgwt.client.core.DataClass
                  at com.smartgwt.client.util.JSOHelper.convertMapToJavascriptObject(JSOHelper.java:1443)
                  at com.smartgwt.client.util.JSOHelper.convertMapToJavascriptObject(JSOHelper.java:1387)
                  at com.smartgwt.client.util.JSOHelper.setAttribute(JSOHelper.java:1375)
                  at com.smartgwt.client.widgets.BaseWidget.setAttribute(BaseWidget.java:879)
                  at com.smartgwt.client.widgets.form.DynamicForm.setValues(DynamicForm.java:2689)
                  at com.test.miniDateRange.client.TestMiniDateRangeItem.onModuleLoad(TestMiniDateRangeItem.java:28)
                  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)

                  Thanks,
                  Ramya
                  Attached Files

                  Comment


                    #10
                    This should be resolved in tomorrow's nightly builds for SGWT 5.0p and newer.
                    Last edited by Isomorphic; 22 Apr 2015, 15:34.

                    Comment

                    Working...
                    X