You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andrea Del Bene (JIRA)" <ji...@apache.org> on 2017/12/15 11:32:00 UTC

[jira] [Commented] (WICKET-6507) Race condition

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

Andrea Del Bene commented on WICKET-6507:
-----------------------------------------

Hi,

refactoring can be fooling sometimes. Once you have extracted your code from onSubmit, modelChanged is called on AbstractWindows and no more on the original component. The correct extracted method would be this:

{code:java}
protected void method(final AjaxRequestTarget target, IndicatingAjaxButton link) {
	AbstractWindow.this.onSubmit(target);
	link.modelChanged();
	close(target);
}
{code}


> Race condition
> --------------
>
>                 Key: WICKET-6507
>                 URL: https://issues.apache.org/jira/browse/WICKET-6507
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 8.0.0-M8
>            Reporter: Kamil
>            Assignee: Andrea Del Bene
>         Attachments: wicket race condition.gif, wicket race condition.mp4, wicket-race-condition-quickstart.zip
>
>
> This bug is weird, but it has probably something to do with race condition.
> I recorded a screencast, so you can clearly see what is wrong.
> When I have some computation directly in "onSubmit" method, then JS alert is invoked properly. If I try to move computation somewhere else (here I just do "extract method" refactoring, but in real life this operation would be executed in some top-level panel or service) then JS is not being invoked (good thing: this behavior is consistent across all of my tries)!
> I attached quickstart so you can try it by yourself. The lines I'm extracting are: AbstractWindow#55



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)