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

@PublishEvent add "global()" to force events on body to improve lookup

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.8.1
    • None
    • tapestry-core
    • None

    Description

      Scenario:

      The component uses <t:container /> and has multiple direct descendants, meaning it will be rendered as it has multiple root nodes.
      Therefore, the PublishServerSideEvents mixin renders the data attribute on the first node.

      If an event is triggered with t5/core/ajax from an element in another component node, the lookup will fall back to <body> to start looking.
      But our <body> has a data-component-events attribute from the layout component.
      So the lookup fails.

      Proposal:

      Adding "boolean global() default false" to @PublishEvent, which will add the events to <body> if true, regardless of the components position in the DOM.
      The idea is that @PublishEvent events are component-bound events; that's why the lookup starts at the provided element, including recursively going upwards.
      If no element is provided, it looks at the body anyway.
      But right now, there's no option to put the url to the event there from Java.

      A proof-of-concept is attached to the ticket.
      As discussed on the mailing list, the first steps should be double-event detection, updating the documentation, and after that, implementing global.

      Attachments

        Activity

          People

            ben-ng Ben Weidig
            ben-ng Ben Weidig
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: