Announcement

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

    DateItem Problem within ListGrid

    SmartGWT Power 2.5, GWT 2.4.
    Firefox 6.0.

    I have a ListGrid and one of its fields is a Date of Birth. Therefore, I have created the following piece of code.

    Code:
            ListGridField dateOfBirth = new ListGridField("DateOfBirth");
            dateOfBirth.setAlign(Alignment.CENTER);
            dob.setStartDate(new DateItem());
            dateOfBirth.setRequired(true);
    
            ListGridField embarkDate = new ListGridField("EmbarkDate");
            embarkDate.setAlign(Alignment.CENTER);
            embarkDate.setEditorType(new DateItem());
            embarkDate.setRequired(true);
    When I test this, everything seems works fine. However when I click on the Year, which produces a list of years ranging from 1995-2015, I notice that I need a wider range of available dates.

    So I saw that the DateItem object has a method, setStartDate(), that accepts a Date object and makes that its starting date.

    Then I modified the above code to look like the following.

    Code:
            ListGridField dateOfBirth = new ListGridField("DateOfBirth");
            dateOfBirth.setAlign(Alignment.CENTER);
            dateOfBirth.setRequired(true);
            DateItem dob = new DateItem();
            dob.setStartDate(new Date(0));
            dateOfBirth.setEditorType(dob);
    
            ListGridField embarkDate = new ListGridField("EmbarkDate");
            embarkDate.setAlign(Alignment.CENTER);
            embarkDate.setEditorType(new DateItem());
            embarkDate.setRequired(true);
    As a result when I click on the Year, I am able to see every year from 1969 - 2015 which is what I was expecting. However, when I select the Year for my "embarkDate" field, I receive the following error as well as the Year list shows up in the exact place of the dateOfBirth field instead of on the embarkDate field:

    21:19:11.034 [ERROR] [mproject] 21:19:11.039:WARN:ButtonTable:isc_ButtonTable_0:ignoring bad or negative width: NaN [enable 'sizing' log for stack trace]

    com.smartgwt.client.core.JsObject$SGWT_WARN: 21:19:11.039:WARN:ButtonTable:isc_ButtonTable_0:ignoring bad or negative width: NaN [enable 'sizing' log for stack trace]
    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:525)
    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:292)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:722)


    Can anyone shed any light on this matter for me? am I doing something incorrectly? Thanks in advance.

    #2
    We've not been able to reproduce this in tests - however, a related bug has been fixed and may address your issue, so please retest with a nightly after tomorrow.

    In the meantime, try calling setUseSharedPicker(false) on the dob DateItem to see whether that fixes the problem. If you continue to see issues, post a complete example we can run that shows the failure.

    Comment


      #3
      I tried using the setUseSharedPicker(false) method and the timing of the error changes but I still get it.

      Next I will try the nightly build and see if I could reproduce the issue.
      I will update the forum upon testing.

      Comment


        #4
        What time-zones are you using?

        Comment


          #5
          I am using whatever the default Time Zone is.

          I have not used the DateFormatter at all.

          However, I just used the nightly build on a mock up test page and I didn't see the error occur.

          I will incorporate the nightly into my build and see if:
          1. The error is in fact gone.
          2. The nightly doesn't change anything else that I have created. (probably won't be just in case)


          On a slightly different note....if I needed the Year Picker to go from the current Year back through 1930, and/or forward through 2040....how can I accomplish this because using dateItem.setStartDate(new Date(0)) only sets the year picker from 1969 through 2015.

          Additionally, if I use the Calendar class I get the error message ".....did you forget to inherit the Calendar class...."

          Any ideas?

          Comment


            #6
            I tested the nightly build with my official build and everything seems to be working as expected.

            However when I launch the application from Eclipse I get the following message on the output screen....

            [INFO] [mproject] - Your *.gwt.xml module configuration prohibits the use of the current doucment rendering mode (document.compatMode=' CSS1Compat').<br>Modify your application's host HTML page doctype, or update your custom 'document.compatMode' configuration property settings.

            Is there any particular reason for this?
            Everything seems to work fine even though I am getting this message...
            Any help is appreciated. Thanks in advance!

            Comment

            Working...
            X