added handler on form close

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@130355 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-14 10:22:11 +00:00
parent 1ba0ec1f00
commit f2c95d4cdd
1 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WS_UPLOAD_TYPE; import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WS_UPLOAD_TYPE;
import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WsPortletInitOperation; import org.gcube.portlets.user.workspace.client.ConstantsExplorer.WsPortletInitOperation;
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent; import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
@ -134,6 +135,7 @@ import org.gcube.portlets.user.workspace.shared.ReportAssignmentACL;
import org.gcube.portlets.user.workspace.shared.SessionExpiredException; import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
import org.gcube.portlets.user.workspace.shared.UserBean; import org.gcube.portlets.user.workspace.shared.UserBean;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCreationFormEvent;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.CreateDatasetForm; import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.CreateDatasetForm;
import org.gcube.portlets.widgets.workspacesharingwidget.client.ConstantsSharing.LOAD_CONTACTS_AS; import org.gcube.portlets.widgets.workspacesharingwidget.client.ConstantsSharing.LOAD_CONTACTS_AS;
import org.gcube.portlets.widgets.workspacesharingwidget.client.MultiDragConstants; import org.gcube.portlets.widgets.workspacesharingwidget.client.MultiDragConstants;
@ -153,6 +155,8 @@ import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.Info; import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.MessageBox; import com.extjs.gxt.ui.client.widget.MessageBox;
import com.github.gwtbootstrap.client.ui.Modal; import com.github.gwtbootstrap.client.ui.Modal;
import com.github.gwtbootstrap.client.ui.event.HideEvent;
import com.github.gwtbootstrap.client.ui.event.HideHandler;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.event.shared.HandlerManager;
@ -250,9 +254,18 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
if (username != null) { if (username != null) {
modal.setTitle("Publish Product"); modal.setTitle("Publish Product");
modal.addStyleName("insert-metadata-modal-style"); modal.addStyleName("insert-metadata-modal-style");
modal.add(new CreateDatasetForm(folderId, username)); modal.add(new CreateDatasetForm(folderId, username, eventBus));
modal.setCloseVisible(true); modal.setCloseVisible(true);
modal.show(); modal.show();
// hide any popup panel opened
modal.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent hideEvent) {
eventBus.fireEvent(new CloseCreationFormEvent());
}
});
} }
else else
Window.alert("Please, logout and login again then retry."); Window.alert("Please, logout and login again then retry.");