Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7844

Can't create a date picker with an XWiki.JavaScriptExtension object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Minor
    • None
    • 3.2.1, 3.5.1
    • Skin - Skinx
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce:
      1: Install Date Picker Extension
      http://maven.xwiki.org/releases/org/xwiki/contrib/xwiki-application-datepicker/1.1/xwiki-application-datepicker-1.1.xar

      2: Create a page with this code or import the xar I post below:
      {

      {velocity}

      }
      #set($discard = $xwiki.jsfx.use("js/scriptaculous/scriptaculous.js"))
      #set($discard = $xwiki.jsx.use("XWiki.DatePickerExtension",

      {'defer':false}

      ))
      #set($discard = $xwiki.ssx.use("XWiki.DatePickerExtension"))

      {

      {html clean="false"}

      }
      <h1>Working example</h1>
      <input type="text" name="mydate" id="mydate_id" />
      <script type="text/javascript">
      var dpicker = new DatePicker(

      { relative : 'mydate_id', language: "$context.language" }

      );
      </script>
      <h2>Issue</h2>
      <input type="text" name="mydate2" id="mydate2_id" />
      {

      {/html}

      }

      {

      {/velocity}

      }

      2bis: If you paste the code and you don't use my xar, add an XWiki.JavaScriptExtension object with this content:
      var dpicker = new DatePicker({
      relative : 'mydate2_id',
      language: "$context.language",
      dateFormat: [ ["dd","mm","yyyy"], "/" ]
      });

      Note that there is no datepicker on the second field.

      Documentation: http://extensions.xwiki.org/xwiki/bin/view/Extension/Date+Picker+Application

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              gdelhumeau Guillaume Delhumeau
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: