[ 
https://issues.apache.org/jira/browse/TAP5-2726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Weidig reassigned TAP5-2726:
--------------------------------

    Assignee: Ben Weidig

> @PublishEvent add "global()" to force events on body to improve lookup
> ----------------------------------------------------------------------
>
>                 Key: TAP5-2726
>                 URL: https://issues.apache.org/jira/browse/TAP5-2726
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.8.1
>            Reporter: Ben Weidig
>            Assignee: Ben Weidig
>            Priority: Minor
>         Attachments: tapestry-publishevents-global.diff
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to