[
https://issues.apache.org/jira/browse/WICKET-316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eelco Hillenius resolved WICKET-316.
------------------------------------
Resolution: Won't Fix
version management got reworked drastically since, so this does not seem to be
relevant anymore.
> 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.