Tapestry 5
  1. Tapestry 5
  2. TAP5-238

Component reference for Grid's empty parameter is misleading; provide a good example

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.16
    • Component/s: None
    • Labels:
      None

      Description

      Doco says default for empty is "block:empty" but this doesn't work. If I leave out the empty parameter then my block with id="empty" is ignored and the standard message about "no data to display" appears. However, if I specify empty="block:empty" then my block is displayed.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        That "block:empty" refers to the block with id 'empty' in the Grid's template. Easiest way is:

        <t:grid ...>
        <t:parameter name="empty">Whatever ...</t:parameter>
        </t:grid>

        Show
        Howard M. Lewis Ship added a comment - That "block:empty" refers to the block with id 'empty' in the Grid's template. Easiest way is: <t:grid ...> <t:parameter name="empty">Whatever ...</t:parameter> </t:grid>
        Hide
        Geoff Callender added a comment -

        I think the documentation needs rewording then. The way I read it, these two examples are functionally identical, yet the first one does not work (the empty block is ignored):

        <t:grid ...>
        <t:block t:id="empty">Whatever ...</t:block>
        </t:grid>

        <t:grid ... t:empty="block:empty">
        <t:block t:id="empty">Whatever ...</t:block>
        </t:grid>

        Show
        Geoff Callender added a comment - I think the documentation needs rewording then. The way I read it, these two examples are functionally identical, yet the first one does not work (the empty block is ignored): <t:grid ...> <t:block t:id="empty">Whatever ...</t:block> </t:grid> <t:grid ... t:empty="block:empty"> <t:block t:id="empty">Whatever ...</t:block> </t:grid>
        Hide
        Howard M. Lewis Ship added a comment -

        Defaults for component parameters are evaluated in the context of the component itself, not its container. So block:empty refers to a block with id 'empty' inside Grid.tml.

        I'm updating some of the documentation to give a clearer example of how to use the empty parameter.

        Show
        Howard M. Lewis Ship added a comment - Defaults for component parameters are evaluated in the context of the component itself, not its container. So block:empty refers to a block with id 'empty' inside Grid.tml. I'm updating some of the documentation to give a clearer example of how to use the empty parameter.
        Hide
        Geoff Callender added a comment -

        Hi Howard,

        I really don't get this. Wy does it behave differently when I specify
        empty="block:empty" compared to not specifying it at all (given that
        its default is also "block:empty")?

        Cheers,

        Geoff

        Show
        Geoff Callender added a comment - Hi Howard, I really don't get this. Wy does it behave differently when I specify empty="block:empty" compared to not specifying it at all (given that its default is also "block:empty")? Cheers, Geoff

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Geoff Callender
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development