Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2234

Either insufficient docs on validwhen or a bug

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.4
    • 1.2 Family
    • Core
    • None
    • Operating System: Windows XP
      Platform: PC
    • 31514

    Description

      There are six fields in the form I receive. All are required and integers. I
      try to use validwhen to validate one of them against the others in the
      following way:

      <field property="END_DATE_DAY" depends="required,integer,validwhen">
      <arg0 key="End day" resource="false"/>
      <msg name="validwhen" key="errors.startEndDate2" resource="true"/>
      <var>
      <var-name>test</var-name>
      <var-value>((this >= START_DATE_DAY) or ((END_DATE_MONTH -
      START_DATE_MONTH) > (12 * (START_DATE_YEAR - END_DATE_YEAR))))</var-value>
      </var>
      </field>

      The idea is quite simple, 'start date' cannot be later than 'end date'. As a
      result this does not work, even if (this >= START_DATE_DAY) is true. The
      documentation on validwhen is negligible. That is why I could not figure out
      whether it is a bug or unsupported feature. Anyway, more documentation should
      be provided on the feature, at least in Javadocs.

      Thanks!

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            yegor.jbanov@spicesoft.com Yegor Jbanov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment