Announcement

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

    DateItem setDefaultChooserDate issue

    SmartGwt 3.0p 2/16 nightly
    Gwt 2.4
    Firefox 6.0

    I have a DynamicForm wtih two DateItem fields

    Start Date
    End Date

    When I use the method.....
    Code:
    startDate.setDefaultChooserDate(projectStartDate)
    endDate.setDefaultChooserDate(projectStartDate)
    The project start date, say is in the past, January 25, 2012.

    When I open up my DateItem field from the DateChooser Icon.
    The Calendar defaults to the Current Date, Today, as opposed to the Date I specified using the above mentioned DefaultChooserDate.

    Is there a reason why?

    #2
    We're not seeing this - can you try creating a standalone test case?

    Comment


      #3
      I was able to recreate the problem.

      The scenario is as follows...

      When the window loads, and the two forms are displayed, initially, the DateChoosers, when Clicked show the date as, Today, which is the default value.

      However, when I use the "Project Id" SelectItem to select a project. I attempt to set the Default Chooser date then and to no avail.

      I've used this method before with validators and the validators are applied correctly. But when apparently, the same is not done with applying a "new" Defualt Chooser Date upon a selection of a project.

      Let me know if anything else is needed.
      Attached Files

      Comment


        #4
        I guess in short is there a way to change the DefaultchooserDate of a DateItem upon a selection of the project with a startDate.

        Because the way I have done it in the previously attached file is not working.

        Is that the right way of accomplishing my goal?

        Comment


          #5
          I thought out my issue a bit more and later realized that I wasn't casting the FormItem correctly.

          I have it working now and if anyone is interested the code is as follows (based on the ChangedEvent):

          Code:
          ((DateItem)addUserForm.getItem("EmbarkDate")).setDefaultChooserDate(p.getAttributeAsDate("StartDate"));

          Comment

          Working...
          X