Announcement

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

    Bug in TimeItem.setValue - 5.0d

    5.0d LGPL 2014-04-24

    Hi guys, working my way through an upgrade and found that calling setValue on a TimeItem passing an Object that is an instance of Date throws an exception, but when cast to Date it works. Wanted to let you know.



    Thanks,
    -B

    #2
    Thanks for pointing this out - it's been fixed for builds dated May 1 and later.

    Comment


      #3
      Thanks Team

      Comment


        #4
        Followup bug - 5.0d 2014-05-06

        Hi guys, 5.0d v 2014-05-06 has a different DateTime bug. The Object data type coming from the CellFormatter added to a ListGridFieldType.DATETIME type used to be type java.util.Date but now it's just a GWT JavaScriptObject.

        Some sample code:

        Code:
        final CellFormatter dateTimeFormatter = new CellFormatter()
        {
            @Override
            public String format(Object value, ListGridRecord record, int rowNum, int colNum)
            {
                if(value instanceof Date)
                {
                  //This used to always execute....
                  return datetimeFormat.format((Date)value);
                }
                
                System.out.println(value.getClass().getName());   //but now the data type is com.google.gwt.core.client.JavaScriptObject
                
                return (String)value;  //So this cast fails  (previously this line never ran)
            }
        };
        
        ListGridField startTimeField = new ListGridField("startTime");
        startTimeField.setType(ListGridFieldType.DATETIME);
        startTimeField.setCellFormatter(dateTimeFormatter);

        Comment


          #5
          We've made a fix to a related area for SGWT 5.0d that will be in the next nightly builds. You may want to retest with the latest when it becomes available.

          Comment


            #6
            Thanks guys - we switched to 4.1p but when we hit 5.0 up again I'll recheck this one.

            Comment

            Working...
            X