Tapestry 5
  1. Tapestry 5
  2. TAP5-1378

Allow Delegate component to be used for creating in-template components

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.4
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Allow the delegate component to accept informal parameters and pass those to the block being rendered as render variables. This allows creating a component-with-a-component extremely easily using a block. I've got an implementation of this that we've used successfully for a while that I can contribute or use as as base.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        I wonder if this could not instead by accomplished using a kind of "local macro" construct, with Tapestry template parser support.

        Show
        Howard M. Lewis Ship added a comment - I wonder if this could not instead by accomplished using a kind of "local macro" construct, with Tapestry template parser support.
        Hide
        Dan Adams added a comment -

        What would the advantages of a local macro be? Are there things you could do with lifecycles or mixins or something that you can't do here that would be useful? I really like the idea of this being at the component level and not having to extend the template spec.

        btw, I'm going to investigate if there is a way to support generics or extended prop expressions beyond what var: supports for this. Although, I've been using an implementation of this for months and months and never needed it. You can always make it a component if you really need to, but the simple support using render variables is really nice to have as an option.

        Show
        Dan Adams added a comment - What would the advantages of a local macro be? Are there things you could do with lifecycles or mixins or something that you can't do here that would be useful? I really like the idea of this being at the component level and not having to extend the template spec. btw, I'm going to investigate if there is a way to support generics or extended prop expressions beyond what var: supports for this. Although, I've been using an implementation of this for months and months and never needed it. You can always make it a component if you really need to, but the simple support using render variables is really nice to have as an option.
        Hide
        Dan Adams added a comment -

        Implemented with support for render variables. I thought about putting it support for autobinding to containing component parameters based on informal parameter name but that could be confusing and it can be put in later.

        Show
        Dan Adams added a comment - Implemented with support for render variables. I thought about putting it support for autobinding to containing component parameters based on informal parameter name but that could be confusing and it can be put in later.
        Hide
        Hudson added a comment -

        Integrated in tapestry-5.2-freestyle #237 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/237/)

        Show
        Hudson added a comment - Integrated in tapestry-5.2-freestyle #237 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/237/ )

          People

          • Assignee:
            Dan Adams
            Reporter:
            Dan Adams
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development