Hi
I have a Singlepage Application where I swap some panels on the main
page depending what the user does. Specifically I have a Panel for
changing the password which looks like:
@SuppressWarnings("serial")
public class ChangePasswordPanel extends Panel
{
@Inject
private ChangePasswordAction action;
@Inject
private AmtUserHome home;
@SuppressWarnings("unchecked")
public ChangePasswordPanel(String id)
{
super(id);
this.setOutputMarkupId(true);
.. some fields added here
Button change = new Button("change", new
ResourceModel("middle.changepw.change"))
{
@Override
public void onSubmit()
{
getPage().addOrReplace(new ChangePasswordSuccessPanel("middle"));
action.saveChanges();
super.onSubmit();
}
};
..some code
Button cancel = new Button("cancel", new
ResourceModel("middle.changepw.cancel"))
{
@Override
public void onSubmit()
{
getPage().addOrReplace(new ChangePasswordPanel("middle"));
getPage().addOrReplace(new ChangePasswordInformationPanel("right"));
super.onSubmit();
}
@Override
public boolean isVisible()
{
PostfachModel model = session.getModel();
return !model.isNeedsPasswordChange();
}
};
cancel.setDefaultFormProcessing(false);
.. some more code
add(form);
container.add(oldPassword);
form.add(cancel, change, text, password, passwordrepeat, container);
}
}
However, I'm encountering the following exception:
java.lang.IllegalStateException: No Page found for component [MarkupContainer
[Component id = cancel]]
at org.apache.wicket.Component.getPage(Component.java:1756)
at
ch.admin.bj.ba.postfach.ui.panels.ChangePasswordPanel$5.onSubmit(ChangePasswordPanel.java:102)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:882)
But only when I click the cancel button (102 points to "
getPage().addOrReplace(new ChangePasswordInformationPanel("right"));
"). The submit(change) button works fine and I'm using in both
onsubmit() almost the identical code. Is there any explanation for this
behaviour? The buttons in the html are identical:
<input type="submit" class="button" wicket:id="change"/>
<input type="submit" class="button" wicket:id="cancel"/>
Wicket version is 1.4.9 on a glassfish 3
Thanks in advance
thierry
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org