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

CLONE -DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 5.0.6
    • None
    • Core Components
    • None
    • -

    Description

      DateField is Tapestry 5 is based on the excellent dynarch.com DHTML/JavaScript Calendar. This calendar provides hooks for javascript callback functions.

      Currently it's not possible to define such an clientside javascript function because the method JSONObject#valueToString is always quoting all the elements of the json object, while javascript expects a reference to a javascript function

      Therefore the js-error: "... not a function" is given.

      For example: what is needed is:
      Calendar.setup(

      {"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":afterUpdateElement}

      );

      while DateField outputs:
      Calendar.setup(

      {"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":"afterUpdateElement"}

      ); // <-- difference is in the quotes round afterUpdateElement

      issue is similar to TAPESTRY-1795 (tapestry 4)

      Attachments

        Issue Links

          Activity

            People

              hlship Howard Lewis Ship
              igor.drobiazko Igor Drobiazko
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: