Skip to content

The Unified and Autonomous Development Platform

midwork

robin shine6f9539ecf947
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
index cc24a32c65..72fb8252b9 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
@@ -139,8 +139,9 @@ pmease.commons = {
trackDirty: function(form) {
var $form = $(form);
if ($form.find(".dirty-aware").length != 0 || $form.hasClass("leave-confirm")) {
+ var silent = !$form.hasClass("leave-confirm");
$form.areYouSure({
- "silent": !$form.hasClass("leave-confirm"),
+ "silent": silent,
"addRemoveFieldsMarksDirty": true,
change: function() {
pmease.commons.form.dirtyChanged($(this));
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/jquery.are-you-sure.patched.js b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/jquery.are-you-sure.patched.js
index 8b5a6f64ad..1a5ab9285d 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/jquery.are-you-sure.patched.js
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/jquery.are-you-sure.patched.js
@@ -1,193 +1,194 @@
-/*!
- * jQuery Plugin: Are-You-Sure (Dirty Form Detection)
- * https://github.com/codedance/jquery.AreYouSure/
- *
- * Copyright (c) 2012-2014, Chris Dance and PaperCut Software http://www.papercut.com/
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Author: [email protected]
- * Version: 1.8.0
- * Date: 22nd June 2014
- */
-(function($) {
-
- $.fn.areYouSure = function(options) {
-
- var settings = $.extend(
- {
- 'message' : 'You have unsaved changes!',
- 'dirtyClass' : 'dirty',
- 'change' : null,
- 'silent' : false,
- 'addRemoveFieldsMarksDirty' : false,
- 'fieldEvents' : 'change keyup propertychange input',
- 'fieldSelector': ":input:not(input[type=submit]):not(input[type=button]):not(button)"
- }, options);
-
- var getValue = function($field) {
- if ($field.hasClass('ays-ignore')
- || $field.hasClass('aysIgnore')
- || $field.attr('data-ays-ignore')
- || $field.attr('name') === undefined) {
- return null;
- }
-
- if ($field.is(':disabled')) {
- return 'ays-disabled';
- }
-
- var val;
- var type = $field.attr('type');
- if ($field.is('select')) {
- type = 'select';
- }
-
- switch (type) {
- case 'checkbox':
- case 'radio':
- val = $field.is(':checked');
- break;
- case 'select':
- if($field.val()) {
- val = $field.val().toString();
- } else if ($field.val() == "") {
- val = "";
- }
- break;
- default:
- val = $field.val();
- }
-
- return val;
- };
-
- var storeOrigValue = function($field) {
- $field.data('ays-orig', getValue($field));
- };
-
- var checkForm = function(evt) {
-
- var isFieldDirty = function($field) {
- var origValue = $field.data('ays-orig');
- if (undefined === origValue) {
- // Patched by Robin to return true here instead of false, as form fields
- // can often be replaced via Ajax while editing the form and this can
- // cause the stored original value missing
- return true;
- }
- return (getValue($field) != origValue);
- };
-
- var $form = ($(this).is('form'))
- ? $(this)
- : $(this).parents('form');
-
- // Test on the target first as it's the most likely to be dirty
- if (isFieldDirty($(evt.target))) {
- setDirtyStatus($form, true);
- return;
- }
-
- $fields = $form.find(settings.fieldSelector);
-
- if (settings.addRemoveFieldsMarksDirty) {
- // Check if field count has changed
- var origCount = $form.data("ays-orig-field-count");
- if (origCount != $fields.length) {
- setDirtyStatus($form, true);
- return;
- }
- }
-
- // Brute force - check each field
- var isDirty = false;
- $fields.each(function() {
- $field = $(this);
- if (isFieldDirty($field)) {
- isDirty = true;
- return false; // break
- }
- });
-
- setDirtyStatus($form, isDirty);
- };
-
- var initForm = function($form) {
- var fields = $form.find(settings.fieldSelector);
- $(fields).each(function() { storeOrigValue($(this)); });
- $(fields).unbind(settings.fieldEvents, checkForm);
- $(fields).bind(settings.fieldEvents, checkForm);
- $form.data("ays-orig-field-count", $(fields).length);
- setDirtyStatus($form, false);
- };
-
- var setDirtyStatus = function($form, isDirty) {
- var changed = isDirty != $form.hasClass(settings.dirtyClass);
- $form.toggleClass(settings.dirtyClass, isDirty);
-
- // Fire change event if required
- if (changed) {
- if (settings.change) settings.change.call($form, $form);
-
- if (isDirty) $form.trigger('dirty.areYouSure', [$form]);
- if (!isDirty) $form.trigger('clean.areYouSure', [$form]);
- $form.trigger('change.areYouSure', [$form]);
- }
- };
-
- var rescan = function() {
- var $form = $(this);
- var fields = $form.find(settings.fieldSelector);
- $(fields).each(function() {
- var $field = $(this);
- if (!$field.data('ays-orig')) {
- storeOrigValue($field);
- $field.bind(settings.fieldEvents, checkForm);
- }
- });
- // Check for changes while we're here
- $form.trigger('checkform.areYouSure');
- };
-
- var reinitialize = function() {
- initForm($(this));
- }
-
- if (!settings.silent && !window.aysUnloadSet) {
- window.aysUnloadSet = true;
- $(window).bind('beforeunload', function() {
- $dirtyForms = $("form").filter('.' + settings.dirtyClass);
- if ($dirtyForms.length == 0) {
- return;
- }
- // Prevent multiple prompts - seen on Chrome and IE
- if (navigator.userAgent.toLowerCase().match(/msie|chrome/)) {
- if (window.aysHasPrompted) {
- return;
- }
- window.aysHasPrompted = true;
- window.setTimeout(function() {window.aysHasPrompted = false;}, 900);
- }
- return settings.message;
- });
- }
-
- return this.each(function(elem) {
- if (!$(this).is('form')) {
- return;
- }
- var $form = $(this);
-
- $form.submit(function() {
- $form.removeClass(settings.dirtyClass);
- });
- $form.bind('reset', function() { setDirtyStatus($form, false); });
- // Add a custom events
- $form.bind('rescan.areYouSure', rescan);
- $form.bind('reinitialize.areYouSure', reinitialize);
- $form.bind('checkform.areYouSure', checkForm);
- initForm($form);
- });
- };
-})(jQuery);
+/*!
+ * jQuery Plugin: Are-You-Sure (Dirty Form Detection)
+ * https://github.com/codedance/jquery.AreYouSure/
+ *
+ * Copyright (c) 2012-2014, Chris Dance and PaperCut Software http://www.papercut.com/
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Author: [email protected]
+ * Version: 1.8.0
+ * Date: 22nd June 2014
+ */
+(function($) {
+
+ $.fn.areYouSure = function(options) {
+
+ var settings = $.extend(
+ {
+ 'message' : 'You have unsaved changes!',
+ 'dirtyClass' : 'dirty',
+ 'change' : null,
+ 'silent' : false,
+ 'addRemoveFieldsMarksDirty' : false,
+ 'fieldEvents' : 'change keyup propertychange input',
+ 'fieldSelector': ":input:not(input[type=submit]):not(input[type=button]):not(button)"
+ }, options);
+
+ var getValue = function($field) {
+ if ($field.hasClass('ays-ignore')
+ || $field.hasClass('aysIgnore')
+ || $field.attr('data-ays-ignore')
+ || $field.attr('name') === undefined) {
+ return null;
+ }
+
+ if ($field.is(':disabled')) {
+ return 'ays-disabled';
+ }
+
+ var val;
+ var type = $field.attr('type');
+ if ($field.is('select')) {
+ type = 'select';
+ }
+
+ switch (type) {
+ case 'checkbox':
+ case 'radio':
+ val = $field.is(':checked');
+ break;
+ case 'select':
+ if($field.val()) {
+ val = $field.val().toString();
+ } else if ($field.val() == "") {
+ val = "";
+ }
+ break;
+ default:
+ val = $field.val();
+ }
+
+ return val;
+ };
+
+ var storeOrigValue = function($field) {
+ $field.data('ays-orig', getValue($field));
+ };
+
+ var checkForm = function(evt) {
+
+ var isFieldDirty = function($field) {
+ var origValue = $field.data('ays-orig');
+ if (undefined === origValue) {
+ // Patched by Robin to return true here instead of false, as form fields
+ // can often be replaced via Ajax while editing the form and this can
+ // cause the stored original value missing
+ return true;
+ }
+ return (getValue($field) != origValue);
+ };
+
+ var $form = ($(this).is('form'))
+ ? $(this)
+ : $(this).parents('form');
+
+ // Test on the target first as it's the most likely to be dirty
+ if (isFieldDirty($(evt.target))) {
+ setDirtyStatus($form, true);
+ return;
+ }
+
+ $fields = $form.find(settings.fieldSelector);
+
+ if (settings.addRemoveFieldsMarksDirty) {
+ // Check if field count has changed
+ var origCount = $form.data("ays-orig-field-count");
+ if (origCount != $fields.length) {
+ setDirtyStatus($form, true);
+ return;
+ }
+ }
+
+ // Brute force - check each field
+ var isDirty = false;
+ $fields.each(function() {
+ $field = $(this);
+ if (isFieldDirty($field)) {
+ isDirty = true;
+ return false; // break
+ }
+ });
+
+ setDirtyStatus($form, isDirty);
+ };
+
+ var initForm = function($form) {
+ var fields = $form.find(settings.fieldSelector);
+ $(fields).each(function() { storeOrigValue($(this)); });
+ $(fields).unbind(settings.fieldEvents, checkForm);
+ $(fields).bind(settings.fieldEvents, checkForm);
+ $form.data("ays-orig-field-count", $(fields).length);
+ setDirtyStatus($form, false);
+ };
+
+ var setDirtyStatus = function($form, isDirty) {
+ var changed = isDirty != $form.hasClass(settings.dirtyClass);
+ $form.toggleClass(settings.dirtyClass, isDirty);
+
+ // Fire change event if required
+ if (changed) {
+ if (settings.change) settings.change.call($form, $form);
+
+ if (isDirty) $form.trigger('dirty.areYouSure', [$form]);
+ if (!isDirty) $form.trigger('clean.areYouSure', [$form]);
+ $form.trigger('change.areYouSure', [$form]);
+ }
+ };
+
+ var rescan = function() {
+ var $form = $(this);
+ var fields = $form.find(settings.fieldSelector);
+ $(fields).each(function() {
+ var $field = $(this);
+ if (!$field.data('ays-orig')) {
+ storeOrigValue($field);
+ $field.bind(settings.fieldEvents, checkForm);
+ }
+ });
+ // Check for changes while we're here
+ $form.trigger('checkform.areYouSure');
+ };
+
+ var reinitialize = function() {
+ initForm($(this));
+ }
+
+ if (!settings.silent && !window.aysUnloadSet) {
+ window.aysUnloadSet = true;
+ $(window).bind('beforeunload', function() {
+ // added by robin to only ask for confirmation for leave-confirm forms
+ $dirtyForms = $("form").filter('.leave-confirm.' + settings.dirtyClass);
+ if ($dirtyForms.length == 0) {
+ return;
+ }
+ // Prevent multiple prompts - seen on Chrome and IE
+ if (navigator.userAgent.toLowerCase().match(/msie|chrome/)) {
+ if (window.aysHasPrompted) {
+ return;
+ }
+ window.aysHasPrompted = true;
+ window.setTimeout(function() {window.aysHasPrompted = false;}, 900);
+ }
+ return settings.message;
+ });
+ }
+
+ return this.each(function(elem) {
+ if (!$(this).is('form')) {
+ return;
+ }
+ var $form = $(this);
+
+ $form.submit(function() {
+ $form.removeClass(settings.dirtyClass);
+ });
+ $form.bind('reset', function() { setDirtyStatus($form, false); });
+ // Add a custom events
+ $form.bind('rescan.areYouSure', rescan);
+ $form.bind('reinitialize.areYouSure', reinitialize);
+ $form.bind('checkform.areYouSure', checkForm);
+ initForm($form);
+ });
+ };
+})(jQuery);
diff --git a/gitplex.product/src/test/java/gitplex/product/Test.java b/gitplex.product/src/test/java/gitplex/product/Test.java
index eb3ee4544a..3522da2a0b 100644
--- a/gitplex.product/src/test/java/gitplex/product/Test.java
+++ b/gitplex.product/src/test/java/gitplex/product/Test.java
@@ -1,12 +1,9 @@
package gitplex.product;
-import java.io.IOException;
-
public class Test {
@org.junit.Test
- public void test() throws IOException {
- System.out.println();
+ public void test() {
}
}
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/confirmdelete/confirm-delete.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/confirmdelete/confirm-delete.css
index 839411e7e4..dd233cdf92 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/confirmdelete/confirm-delete.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/confirmdelete/confirm-delete.css
@@ -1,3 +1,4 @@
-.confirm-delete .message {
- margin-bottom: 20px;
+.confirm-delete .message {
+ margin-bottom: 20px;
+ font-size: 13px;
}
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/AccountSettingPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/AccountSettingPage.java
index fc051dc6fe..78a1150caf 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/AccountSettingPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/AccountSettingPage.java
@@ -3,10 +3,7 @@ package com.pmease.gitplex.web.page.account.setting;
import java.util.ArrayList;
import java.util.List;
-import org.apache.wicket.markup.head.CssHeaderItem;
-import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.CssResourceReference;
import com.pmease.commons.wicket.component.tabbable.PageTab;
import com.pmease.commons.wicket.component.tabbable.Tabbable;
@@ -40,12 +37,4 @@ public abstract class AccountSettingPage extends AccountLayoutPage {
add(new Tabbable("accountSettingTabs", tabs));
}
- @Override
- public void renderHead(IHeaderResponse response) {
- super.renderHead(response);
-
- response.render(CssHeaderItem.forReference(
- new CssResourceReference(AccountSettingPage.class, "account-setting.css")));
- }
-
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/account-setting.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/account-setting.css
deleted file mode 100644
index dc2ba68551..0000000000
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/account/setting/account-setting.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.account-setting>.nav {
- margin-bottom: 20px;
-}
-.account-setting .profile-edit form.name {
- margin-bottom: 16px;
-}
-.account-setting .profile-edit form.name .alert {
- margin-top: 16px;
-}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/base.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/base.css
index e644e758a8..a5d24906a7 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/base.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/base/base.css
@@ -39,10 +39,7 @@ form>.actions {
margin-top: 20px;
}
form>.actions>.btn {
- margin-right: 8px;
-}
-form>.actions>:last-child {
- margin-right: 0;
+ margin-right: 20px;
}
.actions>a {
margin-right: 8px;
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css
index 2174033ce5..8a5b589331 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css
@@ -4,11 +4,8 @@
#depot-setting>.nav {
margin-bottom: 20px;
}
-#depot-setting .general-setting form.name {
- margin-bottom: 16px;
-}
-#depot-setting .general-setting form.name .alert {
- margin-top: 16px;
+#depot-setting .general-setting form .delete {
+ margin-right: 0;
}
.integration-policy-setting .handle {
@@ -185,3 +182,8 @@
#depot-setting .authorization .list td.privilege {
width: 20%;
}
+
+.modal .transfer-depot .message {
+ font-size: 13px;
+ margin-bottom: 20px;
+}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.html
index 3f5a3496a0..21b55a4476 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.html
@@ -4,8 +4,34 @@
<div wicket:id="editor"></div>
<div class="actions">
<input class="btn btn-primary dirty-aware" value="Update" type="submit"></input>
- <a wicket:id="delete" class="btn btn-danger pull-right">Delete this Repository</a>
+ <a wicket:id="delete" class="delete btn btn-danger pull-right">Delete</a>
+ <a wicket:id="transfer" class="transfer btn btn-danger pull-right">Transfer</a>
</div>
</form>
</div>
+ <wicket:fragment wicket:id="transferFrag">
+ <div class="transfer-depot">
+ <!-- Add form tag so that the default delete button can be triggered when user hits return -->
+ <form wicket:id="form">
+ <div class="modal-header">
+ <h4 id="modal-title" class="modal-title">
+ Transfer repository to another account
+ </h4>
+ </div>
+ <div class="modal-body">
+ <div class="message">You can only transfer repository to accounts you have administrative
+ rights on. Also note that original team references in repository
+ authorization and gate keeper definition will be removed after transferring as teams are local to account.</div>
+ <div class="form-group">
+ <input wicket:id="account" type="hidden" class="form-control" placeholder="Select destination account..."></input>
+ <div wicket:id="feedback"></div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <input wicket:id="transfer" type="submit" class="btn btn-danger dirty-aware" value="Transfer"></input>
+ <a wicket:id="cancel" class="btn btn-default">Cancel</a>
+ </div>
+ </form>
+ </div>
+ </wicket:fragment>
</wicket:extend>
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.java
index 4093daf640..b20a7eaa3f 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/general/GeneralSettingPage.java
@@ -1,23 +1,38 @@
package com.pmease.gitplex.web.page.depot.setting.general;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.wicket.Component;
import org.apache.wicket.Session;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.feedback.FencedFeedbackPanel;
import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
+import com.pmease.commons.wicket.component.modal.ModalPanel;
+import com.pmease.commons.wicket.component.select2.ResponseFiller;
import com.pmease.commons.wicket.editable.BeanContext;
import com.pmease.commons.wicket.editable.BeanEditor;
import com.pmease.commons.wicket.editable.PathSegment;
import com.pmease.gitplex.core.GitPlex;
+import com.pmease.gitplex.core.entity.Account;
import com.pmease.gitplex.core.entity.Depot;
+import com.pmease.gitplex.core.manager.AccountManager;
import com.pmease.gitplex.core.manager.DepotManager;
+import com.pmease.gitplex.core.security.SecurityUtils;
+import com.pmease.gitplex.web.Constants;
+import com.pmease.gitplex.web.component.accountchoice.AbstractAccountChoiceProvider;
+import com.pmease.gitplex.web.component.accountchoice.AccountSingleChoice;
import com.pmease.gitplex.web.component.confirmdelete.ConfirmDeleteDepotModal;
import com.pmease.gitplex.web.page.account.depots.DepotListPage;
import com.pmease.gitplex.web.page.depot.setting.DepotSettingPage;
+import com.vaynberg.wicket.select2.Response;
@SuppressWarnings("serial")
public class GeneralSettingPage extends DepotSettingPage {
@@ -82,6 +97,95 @@ public class GeneralSettingPage extends DepotSettingPage {
};
form.add(editor);
+ form.add(new AjaxLink<Void>("transfer") {
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ new ModalPanel(target) {
+
+ private Account account;
+
+ @Override
+ protected Component newContent(String id) {
+ Fragment fragment = new Fragment(id, "transferFrag", GeneralSettingPage.this);
+ Form<?> form = new Form<Void>("form");
+ form.setOutputMarkupId(true);
+ fragment.add(form);
+ form.add(new AccountSingleChoice("account", new IModel<Account>() {
+
+ @Override
+ public void detach() {
+ }
+
+ @Override
+ public Account getObject() {
+ return account;
+ }
+
+ @Override
+ public void setObject(Account object) {
+ account = object;
+ }
+
+ }, new AbstractAccountChoiceProvider() {
+
+ @Override
+ public void query(String term, int page, Response<Account> response) {
+ List<Account> accounts = new ArrayList<>();
+ for (Account account: GitPlex.getInstance(AccountManager.class).all()) {
+ if (!account.equals(getAccount()) && SecurityUtils.canManage(account)) {
+ accounts.add(account);
+ }
+ }
+ new ResponseFiller<Account>(response).fill(accounts, page, Constants.DEFAULT_PAGE_SIZE);
+ }
+
+ }).setRequired(true));
+
+ form.add(new FencedFeedbackPanel("feedback", form));
+
+ form.add(new AjaxButton("transfer") {
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ super.onSubmit(target, form);
+ DepotManager depotManager = GitPlex.getInstance(DepotManager.class);
+ if (depotManager.findBy(account, getDepot().getName()) != null) {
+ form.error("A repository with name '" + getDepot().getName() + "' already exist "
+ + "under this account, please rename the repository and try transfer "
+ + "again");
+ target.add(form);
+ } else {
+ getDepot().setAccount(account);
+ depotManager.save(getDepot(), getAccount().getId(), null);
+ setResponsePage(GeneralSettingPage.class, GeneralSettingPage.paramsOf(getDepot()));
+ Session.get().success("Repository has been transferred successfully");
+ }
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ super.onError(target, form);
+ target.add(form);
+ }
+
+ });
+ form.add(new AjaxLink<Void>("cancel") {
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ close(target);
+ }
+
+ });
+ return fragment;
+ }
+
+ };
+ }
+
+ });
+
form.add(new AjaxLink<Void>("delete") {
@Override