@Override
public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
AbstractBaseBean schema, final boolean createFlag) {
if (schema == null) {
schema = new VirtualSchemaTO();
}
final Form schemaForm = new Form("form");
schemaForm.setModel(new CompoundPropertyModel(schema));
final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
schema, "name"));
name.addRequiredLabel();
name.setEnabled(createFlag);
final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new ResourceModel("submit"), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
protected void onSubmitInternal(final AjaxRequestTarget target, final Form form) {
VirtualSchemaTO schemaTO = (VirtualSchemaTO) form.getDefaultModelObject();
try {
if (createFlag) {
restClient.createVirtualSchema(kind, schemaTO);
} else {
restClient.updateVirtualSchema(kind, schemaTO);