Announcement

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

    BUG REPORT: Behavior change between v5 and v12

    The code below has two very distinct behaviors if ran in SmartGWT 5 vs SmartGWT12.

    In the first case when the button sets the value of the endDateTime item it is shown as relative interval (N Days from), while in SGWT 12 the endDateTime control will show a date.


    Code:
    protected RelativeDateItem startDateTime;
    protected RelativeDateItem endDateTime;
    protected TextItem txtItem = new TextItem();
    protected Button setDate = new Button();
    
    VLayout layout = new VLayout();
    
    @Override
    public void onModuleLoad()
    {
    createStartAndEndDateTimes();
    
    txtItem.setTitle("Value of Date to set");
    txtItem.setValue("+5d");
    
    setDate.setText("Apply Date to end Date");
    setDate.addClickHandler(new ClickHandler()
    {
    
    @Override
    public void onClick(ClickEvent event)
    {
    endDateTime.setValue(txtItem.getValue());
    txtItem.setValue(endDateTime.getDisplayValue());
    }
    });
    
    // add the items to the tool strip
    DynamicForm dateTimeForm = new DynamicForm();
    dateTimeForm.setWidth(425);
    dateTimeForm.setNumCols(2);
    dateTimeForm.setWrapItemTitles(false);
    dateTimeForm.setFields(this.startDateTime, this.endDateTime, txtItem);
    layout.addMember(dateTimeForm);
    layout.addMember(setDate);
    
    layout.draw();
    }
    
    
    /**
    * Method that can be overwritten on a per-market basis to allow for creation of {@link RelativeDateItem} objects
    * to be used for the start and end times.
    */
    protected void createStartAndEndDateTimes()
    {
    //create the objects, set the types, and set the formatters
    this.startDateTime = new RelativeDateItem("startDateTime", "Start Time");
    this.startDateTime.setTitleAlign(Alignment.CENTER);
    this.startDateTime.setType("datetime");
    this.startDateTime.setUse24HourTime(true);
    
    this.endDateTime = new RelativeDateItem("endDateTime", "End Time");
    this.endDateTime.setTitleAlign(Alignment.CENTER);
    this.endDateTime.setType("datetime");
    this.endDateTime.setUse24HourTime(true);
    
    // set the default values and time units
    startDateTime.setShowFutureOptions(true);
    startDateTime.setTimeUnitOptions(TimeUnit.DAY, TimeUnit.HOUR);
    startDateTime.setValue(RelativeDate.TODAY);
    startDateTime.setShowPickerTimeItem(true);
    
    endDateTime.setShowFutureOptions(true);
    endDateTime.setTimeUnitOptions(TimeUnit.DAY, TimeUnit.HOUR);
    endDateTime.setValue("+5d");
    endDateTime.setShowPickerTimeItem(true);
    }

    #2
    A bug like this was fixed recently, and you didn't mention your build date - if it's not very recent, please retest with the latest.

    Comment


      #3
      Originally posted by Isomorphic View Post
      A bug like this was fixed recently, and you didn't mention your build date - if it's not very recent, please retest with the latest.
      Good to know, we are using 12.0-p20180810, and we will re-test with 12.0-p20180830.

      Thanks for the quick response.

      Comment


        #4
        Tested, and tested again with 12.0-p20180911:
        the problem persists

        Comment


          #5
          We see the issue. We'll follow up when we have a solution

          Regards
          Isomorphic Software

          Comment


            #6
            We've made a change here, to address this internally - you can retest with a build dated September 14 or later.

            However, you probably just want to setRangePosition() on your items, which will also address this issue for you.

            Comment

            Working...
            X