You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2010/08/27 09:49:55 UTC

[jira] Resolved: (WICKET-1572) Ajax postcall handler only called once under specific condition

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

Igor Vaynberg resolved WICKET-1572.
-----------------------------------

      Assignee: Igor Vaynberg  (was: Matej Knopp)
    Resolution: Fixed

fixed by WICKET-2999

> Ajax postcall handler only called once under specific condition
> ---------------------------------------------------------------
>
>                 Key: WICKET-1572
>                 URL: https://issues.apache.org/jira/browse/WICKET-1572
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>         Environment: WinXP (build 1.6.0_05-b13)
>            Reporter: Matthew Young
>            Assignee: Igor Vaynberg
>
> The problem is originally raised here: http://www.nabble.com/Ajax-postcall-handler-does-not-get-called-every-time-td16659218.html#a16663054
> 0) Run the quickstart project
> 1) Close all browser windows, then open a browser
> 2) Visit the page (http://localhost:8080)
> 3) click the link, postcall handler is called as expected
> 4) any click again, postcall handler is not called
> Now the strange part
> 0) Leave the browser window open, restart the quickstart project
> 1) Visit the page (http://localhost:8080)
> 2) click the link again and again and postcall handler is called every time as expected
> IE7, FF 2.0.0.14, Safari and Opera and all the same.
> AjaxRegisterPostCallHandler.java    =====================================================
> public class AjaxRegisterPostCallHandler extends WebPage {
> 	private int count;
> 	private static HeaderContributor headerCont = new HeaderContributor(new IHeaderContributor() {
> 		public void renderHead(IHeaderResponse response) {
> 			response
> 					.renderOnLoadJavascript("Wicket.Ajax.registerPostCallHandler(function(){alert('ajax');});");
> 		}
> 	});
> 	
> 	public AjaxRegisterPostCallHandler() {
> 		final WebMarkupContainer container = new WebMarkupContainer("container");
> 		container.setOutputMarkupId(true);
> 		add(container);
> 		Label label = new Label("count", new AbstractReadOnlyModel() {
> 			public Object getObject() {
> 				return count;
> 			}
> 		});
> 		container.add(label);
> 		container.add(new AjaxLink("link") {
> 			public void onClick(AjaxRequestTarget target) {
> 				count++;
> 				target.addComponent(container);
> 				target.appendJavascript(";");
> 			}
> 		});
> 		add(headerCont);
>     }
> }
> AjaxRegisterPostCallHandler.html ================================================
> <html>
>    <head>
>        <title>Test</title>
>    </head>
>    <body>
>        <div wicket:id="container">
>            <div wicket:id="count"></div>
>            <a wicket:id="link">link</a>
>        </div>
>        
>    </body>
> </html>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.