Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2615

"If" component should have an optional "then" parameter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.0
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Right now, if you use If and have a then parameter, the template looks odd, since else isn't in the same nesting and indentation level as the then part. Example:

      <t:if test="something">
          something is true
          <p:else>
              something is false
          </p:else>
      <t:if>
      

      A then parameter would allow everything to be in the same nesting and indentation level. Example:

      <t:if test="something">
          <p:then>
              something is true
          </p:then>
          <p:else>
              something is false
          </p:else>
      <t:if>
      

      If then is missing, everything works as in the past (if test is true, render the body of the If except for the else block; otherwise, render the else block). If then is present, everything outside then and else won't appear regardless of the test being true or false.

      else should also be present in the Unless component, since it and If have almost all their logic inherited from AbstractConditional, their superclass.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thiagohp Thiago Henrique De Paula Figueiredo
                Reporter:
                thiagohp Thiago Henrique De Paula Figueiredo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: