Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-238

DatePicker not calling onchange on text edit, after setting a new value.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0, 3.0.1
    • 3.0.5
    • Contrib
    • None

    Description

      Steps to reproduce:
      1. Create a page with a DatePicker component.
      2. Add an onchange JavaScript call to the DatePicker. E.g.
      <span jwcid="@DatePicker" value="ognl:dateValue"
      onchange="handleDateChanged()">
      <input type="text" value="Day Month Year"/>
      </span>
      3. Click on the Calendar control and change the date.

      Result:
      The text field is updated, but the handleDateChanged() method is not called.

      Expected Result:
      The text field is updated, AND the handleDateChanged() method IS called.

      Fix:
      Change the DatePicker.script in framework/src/org.apache/tapestry/form.

      ${calendarObject}.onchange = function() {
      document.${formName}.${name}.value = ${calendarObject}.formatDate();
      document.${formName}.${name}.onchange(); /* New line invokes the onchange method */
      }

      This works on both Firefox and IE 6.0. It also works when there is no onchange method set.

      Attachments

        Activity

          People

            pferraro Paul Ferraro
            jonathan.oconnor Jonathan O'Connor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: