Package com.googlecode.wicketwebbeans.examples.annotations

Source Code of com.googlecode.wicketwebbeans.examples.annotations.AnnotationsOnBeanPage

package com.googlecode.wicketwebbeans.examples.annotations;


import org.apache.wicket.ajax.AjaxRequestTarget;


import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Form;

import com.googlecode.wicketwebbeans.annotations.Action;
import com.googlecode.wicketwebbeans.containers.BeanForm;
import com.googlecode.wicketwebbeans.model.BeanMetaData;

public class AnnotationsOnBeanPage extends WebPage
{
    private static final long serialVersionUID = 1072855853289135160L;

    public AnnotationsOnBeanPage()
    {
        TestBeanWithAnnotations bean = new TestBeanWithAnnotations();
        BeanMetaData meta = new BeanMetaData(bean.getClass(), "someContext", this, null, false);
        add( new BeanForm("beanForm", bean, meta) );
    }

    @Action(confirm = "Are you sure you want to save?")
    public void save(AjaxRequestTarget target, Form form, TestBeanWithAnnotations bean)
    {
       
        if (!BeanForm.findBeanFormParent(form).validateRequired()) {
            return; // Errors
        }
       
        info("Saved");
    }
}
TOP

Related Classes of com.googlecode.wicketwebbeans.examples.annotations.AnnotationsOnBeanPage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.