The answer is simple: use a model.
private int counter;
...
form.add(new AjaxButton("ajax-button", new PropertyModel<String>(this,
"counter", form)) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
counter++;
target.addComponent(this);
}
});
, , Wicket: - , . , , "" Swing.
N.b.: , .