Search in sources :

Example 1 with StatelessForm

use of org.apache.wicket.markup.html.form.StatelessForm in project wicket by apache.

the class StatelessPageWithFeedback method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    setStatelessHint(true);
    error("error in onInitialize");
    add(new FeedbackPanel("feedback"));
    StatelessForm<Void> form = new StatelessForm<Void>("form");
    add(form);
    form.add(new SubmitLink("submit") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit() {
            StatelessPageWithFeedback.this.error("error in onSubmit");
        }
    });
}
Also used : FeedbackPanel(org.apache.wicket.markup.html.panel.FeedbackPanel) SubmitLink(org.apache.wicket.markup.html.form.SubmitLink) StatelessForm(org.apache.wicket.markup.html.form.StatelessForm)

Example 2 with StatelessForm

use of org.apache.wicket.markup.html.form.StatelessForm 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

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