Tapestry
  1. Tapestry
  2. TAPESTRY-2087

Add "else" parameter to Unless component.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.10
    • Fix Version/s: 5.0.11
    • Component/s: Core Components
    • Labels:
      None

      Description

      It'd be nice if the Unless component had an "else" parameter similar to that of the If component. While the If component could be used instead, it allows the primary condition to appear before the exceptional one in the template.

        Activity

        Hide
        Kevin Menard added a comment -

        Is there any reason that this component doesn't just delegate to the If component? The only thing I can think of is to achieve as much performance in the core as possible . . .

        In any event, implementing it via duplication of logic or by delegation is simple enough. My preference would be the latter for conciseness and to avoid dumb logic errors. I just don't want to be stepping on any design toes if there was a reason to not delegate in the first place.

        Show
        Kevin Menard added a comment - Is there any reason that this component doesn't just delegate to the If component? The only thing I can think of is to achieve as much performance in the core as possible . . . In any event, implementing it via duplication of logic or by delegation is simple enough. My preference would be the latter for conciseness and to avoid dumb logic errors. I just don't want to be stepping on any design toes if there was a reason to not delegate in the first place.
        Hide
        Kevin Menard added a comment -

        Fixed. I decided not to delegate because of issues with components including sub-components without having a template. The overhead of adding a template probably nullified the benefit of delegation in this case. If components implemented purely in Java can ever embed other components, I would reevaluate things at that point.

        Show
        Kevin Menard added a comment - Fixed. I decided not to delegate because of issues with components including sub-components without having a template. The overhead of adding a template probably nullified the benefit of delegation in this case. If components implemented purely in Java can ever embed other components, I would reevaluate things at that point.

          People

          • Assignee:
            Kevin Menard
            Reporter:
            Kevin Menard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development