You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/07/17 15:30:00 UTC

[jira] [Commented] (WICKET-6902) Change of PartialPageUpdate order of onAfterResponse and writePriorityEvaluations makes IListener.onAfterResponde ignore prepended javascripts

    [ https://issues.apache.org/jira/browse/WICKET-6902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17382590#comment-17382590 ] 

ASF subversion and git services commented on WICKET-6902:
---------------------------------------------------------

Commit 1f2064274c8c5385e66a71ff3445bdf84871561a in wicket's branch refs/heads/WICKET-6902-js-after-components from Sven Meier
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=1f20642 ]

WICKET-6902 allow prepend and append

up-to including #onAfterRespond()


> Change of PartialPageUpdate order of onAfterResponse and writePriorityEvaluations makes IListener.onAfterResponde ignore prepended javascripts
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-6902
>                 URL: https://issues.apache.org/jira/browse/WICKET-6902
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 9.3.0
>            Reporter: Tobias Haupt
>            Assignee: Sven Meier
>            Priority: Major
>         Attachments: prependjs-quickstart.zip
>
>
> In wicket 8 it was possible to call AjaxRequestTarget.prependJavaScript from within IListener.onAfterRespond. 
> A change in:
> https://github.com/apache/wicket/commit/b7f62a6591ea3e98374079555c877ba70ba30286#diff-d78837c7a0946ee5118aea1054d96c774a7d381d16dc5374ea87e7f018c6be94
> was made, that switched the order of writePriorityEvaluations and onAfterRespond calls.
> The javadoc of IListener.onAfterRespond states:
> "NOTE: During this stage of processing any calls to target that manipulate the response (adding components, javascript) will have no effect"
> This statement is problematic, because it has not been correct in wicket 8. There it was possible to prepend and append javascripts to the current AjaxRequestTarget at that stage. Now it is no longer possible to prepend javascripts, but still possible to append them.
> In AjaxRequestHandler (line 148) there is a comment: "create response that will be used by listeners to append javascript". This implies, that it should be possible to add javascripts somehow.
> Clarification needed:
> - Why has the order been changed in the first place? Was it related to a fix in WICKET-6703?
> - Is the javadoc correct? When why can javascripts still be appended?
> - Can the PartialPageUpdate use Freezing to throw Exceptions whenever things are added too late and are already written? Like in AjaxRequestHandler.listenersFrozen. The current behavior (simply ignoring scripts) is error prone and made our application fail silently at runtime.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)