Search in sources :

Example 1 with StatelessLink

use of org.apache.wicket.markup.html.link.StatelessLink in project sandbox by irof.

the class StatelessPage method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    Form<Void> form = new StatelessForm<Void>("form") {

        @Override
        protected void onSubmit() {
            model.setObject(LocalDateTime.now().toString());
        }
    };
    form.add(new Label("message", model));
    add(form);
    add(new StatelessLink("link.instance") {

        @Override
        public void onClick() {
            setResponsePage(new StatelessPage());
        }
    });
    add(new StatelessLink("link.class") {

        @Override
        public void onClick() {
            setResponsePage(StatelessPage.class);
        }
    });
    add(new StatelessLink("link.this") {

        @Override
        public void onClick() {
            setResponsePage(StatelessPage.this);
        }
    });
    add(new BookmarkablePageLink("link.stateful", StatefulPage.class));
    add(new BookmarkablePageLink("link.stateless", StatelessPage.class));
    add(new Label("version", getApplication().getFrameworkSettings().getVersion()));
    add(new Label("page.instance", this.toString()));
}
Also used : BookmarkablePageLink(org.apache.wicket.markup.html.link.BookmarkablePageLink) StatelessLink(org.apache.wicket.markup.html.link.StatelessLink) Label(org.apache.wicket.markup.html.basic.Label) StatelessForm(org.apache.wicket.markup.html.form.StatelessForm)

Aggregations

Label (org.apache.wicket.markup.html.basic.Label)1 StatelessForm (org.apache.wicket.markup.html.form.StatelessForm)1 BookmarkablePageLink (org.apache.wicket.markup.html.link.BookmarkablePageLink)1 StatelessLink (org.apache.wicket.markup.html.link.StatelessLink)1