Added ReloadDatasetPageEvent
This commit is contained in:
parent
89ae69d54b
commit
515c3ebb88
|
@ -17,6 +17,8 @@ import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCre
|
|||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.CloseCreationFormEventHandler;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.DeleteCustomFieldEvent;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.DeleteCustomFieldEventHandler;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEvent;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEventHandler;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.metadata.CustomFieldEntry;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.AddResourceToDataset;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources.ManageResources;
|
||||
|
@ -354,6 +356,20 @@ public class CreateDatasetForm extends Composite {
|
|||
InfoIconsLabels.closeDialogBox(popupOpenedIds);
|
||||
}
|
||||
});
|
||||
|
||||
eventBusPublisherWidget.addHandler(ReloadDatasetPageEvent.TYPE, new ReloadDatasetPageEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onReloadDatasetPage(ReloadDatasetPageEvent addResourceEvent) {
|
||||
|
||||
// Firing the event on the main application bus
|
||||
if (addResourceEvent.getDatasetIDorName() != null) {
|
||||
eventBusMainApplication
|
||||
.fireEvent(new ReloadDatasetPageEvent(addResourceEvent.getDatasetIDorName()));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1266,11 +1282,16 @@ public class CreateDatasetForm extends Composite {
|
|||
}
|
||||
}
|
||||
|
||||
//firing the event to load the dataset in the Portlet
|
||||
eventBusPublisherWidget.fireEvent(new ReloadDatasetPageEvent(createdDatasetBean.getId()));
|
||||
|
||||
} else {
|
||||
|
||||
alertOnCreate(ERROR_PRODUCT_CREATION, false, AlertType.ERROR, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1336,6 +1336,8 @@ public class UpdateDatasetForm extends Composite {
|
|||
// if we are in the "general case" we need to show a form for adding resources
|
||||
bindManageResources(createdDatasetBean, datasetUrl, 3);
|
||||
|
||||
eventBusPublisherWidget.fireEvent(new ReloadDatasetPageEvent(createdDatasetBean.getId()));
|
||||
|
||||
} else {
|
||||
|
||||
alertOnCreate(ERROR_PRODUCT_CREATION, false, AlertType.ERROR, true);
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.resources;
|
|||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherService;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherServiceAsync;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.AddResourceEvent;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.events.ReloadDatasetPageEvent;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.LoaderIcon;
|
||||
|
||||
|
@ -146,6 +147,7 @@ public class AddResourceToDataset extends Composite{
|
|||
if(result != null){
|
||||
showAlert("Resource created correctly", AlertType.SUCCESS);
|
||||
eventBus.fireEvent(new AddResourceEvent(result));
|
||||
eventBus.fireEvent(new ReloadDatasetPageEvent(datasetId));
|
||||
|
||||
// remove data
|
||||
resourceUrlTextBox.setText("");
|
||||
|
|
Loading…
Reference in New Issue