You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2016/04/01 07:18:39 UTC

svn commit: r1737307 - in /openmeetings/application: branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/ trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/

Author: solomax
Date: Fri Apr  1 05:18:39 2016
New Revision: 1737307

URL: http://svn.apache.org/viewvc?rev=1737307&view=rev
Log:
[OPENMEETINGS-1330] confirmation is displayed while contact deletion

Modified:
    openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
    openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java

Modified: openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java?rev=1737307&r1=1737306&r2=1737307&view=diff
==============================================================================
--- openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java (original)
+++ openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java Fri Apr  1 05:18:39 2016
@@ -572,15 +572,20 @@ public class MessagesContactsPanel exten
 				}).setVisible(uc.isPending()));
 				item.add(new WebMarkupContainer("view").add(AttributeAppender.append("onclick", String.format("showUserInfo(%s);", userId))));
 				item.add(new WebMarkupContainer("message").add(AttributeAppender.append("onclick", String.format("privateMessage(%s);", userId))).setVisible(!uc.isPending()));
-				item.add(new WebMarkupContainer("delete").add(new AjaxEventBehavior("click") {
+				item.add(new ConfirmableAjaxBorder("delete", getString("80"), getString("833")) {
 					private static final long serialVersionUID = 1L;
-
+					
 					@Override
-					protected void onEvent(AjaxRequestTarget target) {
+					protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+						attributes.setEventPropagation(EventPropagation.STOP_IMMEDIATE);
+					}
+					
+					@Override
+					protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
 						getBean(UserContactDao.class).delete(contactId);
 						updateContacts(target);
 					}
-				}).setVisible(!uc.isPending()));
+				}.setVisible(!uc.isPending()));
 			}
 		};
 		updateContacts(null);

Modified: openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java?rev=1737307&r1=1737306&r2=1737307&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java (original)
+++ openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/profile/MessagesContactsPanel.java Fri Apr  1 05:18:39 2016
@@ -572,15 +572,20 @@ public class MessagesContactsPanel exten
 				}).setVisible(uc.isPending()));
 				item.add(new WebMarkupContainer("view").add(AttributeAppender.append("onclick", String.format("showUserInfo(%s);", userId))));
 				item.add(new WebMarkupContainer("message").add(AttributeAppender.append("onclick", String.format("privateMessage(%s);", userId))).setVisible(!uc.isPending()));
-				item.add(new WebMarkupContainer("delete").add(new AjaxEventBehavior("click") {
+				item.add(new ConfirmableAjaxBorder("delete", getString("80"), getString("833")) {
 					private static final long serialVersionUID = 1L;
-
+					
 					@Override
-					protected void onEvent(AjaxRequestTarget target) {
+					protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+						attributes.setEventPropagation(EventPropagation.STOP_IMMEDIATE);
+					}
+					
+					@Override
+					protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
 						getBean(UserContactDao.class).delete(contactId);
 						updateContacts(target);
 					}
-				}).setVisible(!uc.isPending()));
+				}.setVisible(!uc.isPending()));
 			}
 		};
 		updateContacts(null);