public class Contact extends LayoutPage { private static final long serialVersionUID = 1L; public Contact() { final DojoFloatingPane pane1 = new DojoFloatingPane("contactPane"); pane1.setHasShadow(true); pane1.setHeight("350px"); pane1.setWidth("400px"); pane1.setDisplayMinimizeAction(false); pane1.setTitle("Contact Form"); pane1.add(new ContactForm("contactform",pane1)); add(pane1); } public class ContactForm extends Form { private String name; private String email; private String body; private DojoFloatingPane pane1; public ContactForm(String id, final DojoFloatingPane pane1) { super(id); this.pane1 = pane1; add(new TextField("name",new PropertyModel(this,"name")).setRequired(true).add(new FXValidationAjaxHandler("onblur"))); add(new TextField("email",new PropertyModel(this,"email")).add(EmailAddressValidator.getInstance()).setRequired(true). add(new FXValidationAjaxHandler("onblur"))); add(new TextArea("body",new PropertyModel(this,"body")).setRequired(true).add(new FXValidationAjaxHandler("onblur"))); add(new AjaxSubmitButton("submit") { @Override protected void onSubmit(AjaxRequestTarget arg0, Form arg1) { pane1.close(arg0); } }); } //getters and setters here }