diff options
author | Martin Spielmann <martin.spielmann@pingunaut.com> | 2016-11-18 23:31:27 +0100 |
---|---|---|
committer | Martin Spielmann <martin.spielmann@pingunaut.com> | 2016-11-18 23:56:17 +0100 |
commit | 7f33a835295216210b7ca63367a460d76f9738d0 (patch) | |
tree | aa160c8bdb2dc593af36c8646587b0c6544daf67 /src/main/java/com/gitblit/wicket/pages | |
parent | 88a91a87fad8158fc2c5ca2b9002b037894c6e97 (diff) | |
download | gitblit-7f33a835295216210b7ca63367a460d76f9738d0.tar.gz gitblit-7f33a835295216210b7ca63367a460d76f9738d0.zip |
Updated to latest wicket milestone and fix upgrade errors
Some APIs changed like AjaxButton.onSubmit. All compile errors fixed and
also RuntimeExceptions caused by wrong ajax event usages are resolved.
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages')
7 files changed, 17 insertions, 12 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java b/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java index ccb807c6..5ba57b40 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java @@ -120,7 +120,7 @@ public class EditMilestonePage extends RepositoryPage { private static final long serialVersionUID = 1L;
@Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ protected void onSubmit(AjaxRequestTarget target) {
String name = nameModel.getObject();
if (StringUtils.isEmpty(name)) {
return;
@@ -180,7 +180,7 @@ public class EditMilestonePage extends RepositoryPage { }
};
- delete.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
+ delete.add(new JavascriptEventConfirmation("click", MessageFormat.format(
getString("gb.deleteMilestone"), oldName)));
form.add(delete);
diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java index 61e6b0c9..a68f3d3e 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -28,6 +28,7 @@ import java.util.Set; import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
import org.apache.wicket.extensions.markup.html.form.palette.Palette;
@@ -369,8 +370,10 @@ public class EditRepositoryPage extends RootSubPage { // custom fields
repositoryModel.customFields = new LinkedHashMap<String, String>();
- for (int i = 0; i < customFieldsListView.size(); i++) {
- ListItem<String> child = (ListItem<String>) customFieldsListView.get(i);
+ Iterator<Component> customFieldsListViewIterator = customFieldsListView.iterator();
+ while(customFieldsListViewIterator.hasNext()){
+
+ ListItem<String> child = (ListItem<String>) customFieldsListViewIterator.next();
String key = child.getModelObject();
TextField<String> field = (TextField<String>) child.get("customFieldValue");
@@ -709,7 +712,7 @@ public class EditRepositoryPage extends RootSubPage { };
if (canDelete) {
- delete.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
+ delete.add(new JavascriptEventConfirmation("click", MessageFormat.format(
getString("gb.deleteRepository"), repositoryModel)));
}
form.add(delete.setVisible(canDelete));
diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java index 8cc2c611..b3be019b 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java @@ -62,7 +62,9 @@ import com.google.common.base.Optional; */
public class EditTicketPage extends RepositoryPage {
- static final String NIL = "<nil>";
+ private static final long serialVersionUID = 1L;
+
+ static final String NIL = "<nil>";
static final String ESC_NIL = StringUtils.escapeForHtml(NIL, false);
@@ -261,7 +263,7 @@ public class EditTicketPage extends RepositoryPage { private static final long serialVersionUID = 1L;
@Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ protected void onSubmit(AjaxRequestTarget target) {
long ticketId = 0L;
try {
String h = WicketUtils.getObject(getPageParameters());
diff --git a/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java b/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java index 833c6d47..f78b1c44 100644 --- a/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java +++ b/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java @@ -87,7 +87,7 @@ public class NewMilestonePage extends RepositoryPage { private static final long serialVersionUID = 1L;
@Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ protected void onSubmit(AjaxRequestTarget target) {
String name = nameModel.getObject();
if (StringUtils.isEmpty(name)) {
// invalid name
diff --git a/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java b/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java index 1fd5839d..45478bc8 100644 --- a/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java @@ -191,7 +191,7 @@ public class NewTicketPage extends RepositoryPage { private static final long serialVersionUID = 1L;
@Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ protected void onSubmit(AjaxRequestTarget target) {
String title = titleModel.getObject();
if (StringUtils.isEmpty(title)) {
return;
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index 290d6437..77d2236a 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -1649,7 +1649,7 @@ public class TicketPage extends RepositoryPage { // javascript: manual copy & paste with modal browser prompt dialog
Fragment copyFragment = new Fragment(wicketId, "jsPanel", TicketPage.this);
ContextImage img = WicketUtils.newImage("copyIcon", "clippy.png");
- img.add(new JavascriptTextPrompt("onclick", "Copy to Clipboard (Ctrl+C, Enter)", text));
+ img.add(new JavascriptTextPrompt("click", "Copy to Clipboard (Ctrl+C, Enter)", text));
copyFragment.add(img);
return copyFragment;
}
@@ -1729,7 +1729,7 @@ public class TicketPage extends RepositoryPage { WicketUtils.setHtmlTooltip(deleteLink, MessageFormat.format(getString("gb.deletePatchset"), patchset.number));
- deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(getString("gb.deletePatchset"), patchset.number)));
+ deleteLink.add(new JavascriptEventConfirmation("click", MessageFormat.format(getString("gb.deletePatchset"), patchset.number)));
return deleteLink;
}
diff --git a/src/main/java/com/gitblit/wicket/pages/UserPage.java b/src/main/java/com/gitblit/wicket/pages/UserPage.java index b37e75d8..8908016c 100644 --- a/src/main/java/com/gitblit/wicket/pages/UserPage.java +++ b/src/main/java/com/gitblit/wicket/pages/UserPage.java @@ -273,7 +273,7 @@ public class UserPage extends RootPage { private static final long serialVersionUID = 1L;
@Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ protected void onSubmit(AjaxRequestTarget target) {
UserModel user = GitBlitWebSession.get().getUser();
|