added handler on form close
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130352 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0e8851ce75
commit
60f784cd04
|
@ -21,9 +21,12 @@ import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserOr
|
|||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.ShowUserOrganizationsEventHandler;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.view.GCubeCkanDataCatalogPanel;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCreationFormEvent;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.CreateDatasetForm;
|
||||
|
||||
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.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
@ -82,9 +85,18 @@ public class CkanEventHandlerManager {
|
|||
if (username != null) {
|
||||
modal.setTitle("Publish Product");
|
||||
modal.addStyleName("insert-metadata-modal-style");
|
||||
modal.add(new CreateDatasetForm(username));
|
||||
modal.add(new CreateDatasetForm(username, eventBus));
|
||||
modal.setCloseVisible(true);
|
||||
modal.show();
|
||||
|
||||
// hide any popup panel opened
|
||||
modal.addHideHandler(new HideHandler() {
|
||||
|
||||
@Override
|
||||
public void onHide(HideEvent hideEvent) {
|
||||
eventBus.fireEvent(new CloseCreationFormEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
Window.alert("Please, logout and login again then retry.");
|
||||
|
|
Loading…
Reference in New Issue