I've made a quickstart project trying to reproduce your code, but I
didn't get your problem.
The project is based on 1.4.18 and has just one homepage.
Markup code:
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>
<div wicket:id="panel1">
<form wicket:id="form">
<button wicket:id="subBut"></button>
</form>
</div>
<div wicket:id="panel2">
<span wicket:id="feedBack"></span>
</div>
</body>
</html>
Java code:
public class HomePage extends WebPage {
private static final long serialVersionUID = 1L;
private FeedbackPanel feedbackPanel;
public HomePage(final PageParameters parameters) {
WebMarkupContainer panel1 = new WebMarkupContainer("panel1");
WebMarkupContainer panel2 = new WebMarkupContainer("panel2");
Form form = new Form("form");
form.setOutputMarkupId(true);
AjaxButton subBut = new AjaxButton("subBut") {
@Override
protected void onError(AjaxRequestTarget target,
Form<?> form) {
target.addComponent(feedbackPanel); // it renders,
no problem
target.addComponent(form);
}
@Override
protected void onSubmit(AjaxRequestTarget target,
Form<?> form) {
info("Saved"); // just an info message
target.addComponent(form);
target.addComponent(feedbackPanel); // no way
}
};
panel1.add(form);
form.add(subBut);
panel2.add(feedbackPanel = new FeedbackPanel("feedBack"));
feedbackPanel.setOutputMarkupId(true);
add(panel1);
add(panel2);
}
}
Hi Andre; Thanks for your answer.
I didn't override form's onSubmit method.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]