You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Johan Compagner (JIRA)" <ji...@apache.org> on 2007/10/16 10:42:50 UTC

[jira] Commented: (WICKET-316) versionManager in class Page is null when toggling visibility for a component using ajax

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

Johan Compagner commented on WICKET-316:
----------------------------------------

the version manager is still there, and the code in the page is still pretty much sort of the same.
So if Johan still have this problem with the latest beta of 1.3 please reopen.

> versionManager in class Page is null when toggling visibility for a component using ajax
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-316
>                 URL: https://issues.apache.org/jira/browse/WICKET-316
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 2.0 branch (discontinued)
>         Environment: Both IE and Firefox
>            Reporter: Johan Haleby
>            Assignee: Johan Compagner
>             Fix For: 2.0 branch (discontinued)
>
>
> Here is a simple example that demonstrates the issue: 
> public BasePage() {
>         final WebMarkupContainer table = new WebMarkupContainer(this, "tableId");
>         table.setOutputMarkupId(true);
>         final Label label = new Label(table, "labelId", "This is a label");
>         label.setOutputMarkupId(true);
>         label.setVisible(false);
>         new AjaxFallbackLink(this, "linkId") {
>                private static final long serialVersionUID = 5523627214368899839L;
>               @Override
>               public void onClick(AjaxRequestTarget target) {
>                       final boolean visible = label.isVisible();
>                       label.setVisible(!visible);
>                       target.addComponent(table);
>              }
>        };
> } 
> What happens is that I'd like to show and hide a label by switching between setVisible(true) and setVisible(false) when clicking on a AjaxFallbackLink. I've wrapped the label inside a WebMarkupContainer to make this doable. When I click on the AjaxFallbackLink the first time everything is fine, the label (with wicket id "labelId") gets visible. But when I click the link again to make it invisible, I get a NullPointerException when executing label.setVisible(..). Debugging down into the wicket source code tells me that the NullPointerException occurs on line 327 in class Page, when it tries to execute "versionManager.componentStateChanging(change)". However versionManager is null. I get the same error when I run the AjaxMouseEventPage example from wicket-examples. First time I click or move the mouse over one of the boxes in the example everything is fine, but once I do it again the NullPointerException is thrown at the exact same location as in the "visibility" example abov
 e. 

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