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

Macro parameter of type Date not showing any result

    XMLWordPrintable

Details

    • Unknown

    Description

      Obviously the default displayer associated to macro parameters of type Date (the Date Picker) is not compatible with the Date converter für the parameter.

      When I have set the type java.util.Date in the object WikiMacroParameterClass giving the parameter-name “someDate”, I observe the following: I can fill in the field of someDate in the macro form with the Date Picker working. But after saving the form in the code of the macro the reference $wikimacro.parameters.someDate doesn't have any value. It's just null.

      You can test it with the following Velocity-code in a macro, where the conversion is working with the described setting for the parameter someDate, though only with String as an intermediate type and through another binding ($wikimakro.context or $xcontext), while wikimacro.parameters.someDate is empty.

      #set($valueAsDate = $datetool.toDate('yyyy/MM/dd H:m',"$!wikimacro.context.getCurrentMacroBlock().getParameter('someDate')"))
      someDate after conversion: $valueAsDate
      #if ("$!wikimacro.parameters.someDate" == '')
        Parameter someDate ist empty!
      #else
        Parameter somedate has the value $!wikimacro.parameters.someDate
      #end

      Could it have to do with the issue 14894?

      Attachments

        Activity

          People

            Unassigned Unassigned
            guihin Guido Hinz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: