
org.apache.wicket.examples.basic.linkcounter.LinkCounterPage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wicket-examples-jar Show documentation
Show all versions of wicket-examples-jar Show documentation
Jar file for the Wicket examples.
The newest version!
package org.apache.wicket.examples.basic.linkcounter;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.Model;
public class LinkCounterPage extends WebPage {
private static final long serialVersionUID = 1L;
private int counter = 0;
private Label counterLabel;
public LinkCounterPage() {
add(counterLabel = new Label("counter", Model.of(counter)));
add(new Link("link") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
counter++;
counterLabel.setDefaultModelObject(counterLabel);
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy