Announcement

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

    DateItem datatype strange behaviour/bug

    (Smartgwt pro 6.0-p20171202)

    Please consider the following simple testcase:
    Code:
    IButton button = new IButton("check datatype");  
    
    form = new DynamicForm();
    DateItem item = new DateItem();
    item.setShowPickerIcon(false); item.setTitle("Make my day");  
    form.setItems(item);  
    
    button.addClickHandler(new ClickHandler() {    
        @Override    
        public void onClick(ClickEvent clickEvent) {        
        SC.say("Year: "+ item.getYearSelector().getValue().getClass().toString() + ", Month: " + item.getMonthSelector().getValue().getClass().toString() + ", Day: "+item.getDaySelector().getValue().getClass().toString());    
    } });
    I discovered that if the user has not done anything, and the dateitem has all default values, the datatypes for all parts of the dateitem is integer. However, if you go ahead and change them all, the year and day still has the integer datatype, but the month changes to string!

    I would guess it's related to the fact that the month is displayed with a string ("Jan", "Feb" etc.), but the others are numbers?

    To me, it feels very strange that the datatype of the field sent to the server differs depending on whether the end user has changed something or not (and only for one of three fields!). Don't you agree?

    Cheers

    #2
    The datatype sent to the server is always a Date. The individual selectors are internal details.

    Comment


      #3
      OK. The getYearSelector is public, so i thought i could call it.

      Comment

      Working...
      X