You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2011/04/23 10:48:05 UTC

[jira] [Commented] (WICKET-3584) Ajax re-render fails if a instantiation listener calls setOutputMarkupId(true) on every component.

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

Juergen Donnerstag commented on WICKET-3584:
--------------------------------------------

tested against 1.5 to check if error occurs as well => 1.5 seems to be ok.

> Ajax re-render fails if a instantiation listener calls setOutputMarkupId(true) on every component.
> --------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3584
>                 URL: https://issues.apache.org/jira/browse/WICKET-3584
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.4.17
>         Environment: Windows Vista, JDK 1.6_22, Eclipse Helios, Maven 3.0.x
>            Reporter: Ronald Tetsuo Miura
>
> If you setup a IComponentInstantiationListener that calls setOutputMarkupId(true) to every component, the tags with the enclosure attribute don't get re-rendered on ajax requests, because the generated IDs from the HTML placeholder and the Ajax response don't match.
> Code:
> public class App extends WebApplication {
>    @Override
>    protected void init() {
>        addComponentInstantiationListener(new IComponentInstantiationListener() {
>            public void onInstantiation(Component component) {
>                component.setOutputMarkupId(true);
>            }
>        });
>    }
>    @Override
>    public Class<? extends Page> getHomePage() {
>        return HomePage.class;
>    }
> }
> public class HomePage extends WebPage {
>    public HomePage() {
>        final Label label = new Label("label", "VISIBLE!");
>        add(label.setVisible(false).setOutputMarkupId(true));
>        add(new AjaxLink<Void>("link") {
>            @Override
>            public void onClick(AjaxRequestTarget target) {
>                label.setVisible(!label.isVisible());
>                target.addComponent(label);
>            }
>        });
>    }
> }
> <html xmlns:wicket="http://wicket.apache.org">
> <body>
> <a wicket:id="link">Clique!</a>
> <div wicket:enclosure="label">
>  <hr/>
>    <h1 wicket:id="label"></h1>
>  <hr/>
> </div>
> </body>
> </html>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira