Fixed refresh issue

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@147100 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-04-21 14:14:30 +00:00
parent 04867bfba0
commit 45e3e243a2
1 changed files with 29 additions and 31 deletions

View File

@ -16,6 +16,7 @@ import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer; import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
@ -57,36 +58,28 @@ public class DataMinerManager implements EntryPoint {
// onModuleLoad2 // onModuleLoad2
Scheduler.get().scheduleDeferred(new ScheduledCommand() { Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() { public void execute() {
//loadScope(); // loadScope();
loadMainPanel(); loadMainPanel();
} }
}); });
} }
/*private void loadScope() { /*
ClientScopeHelper.getService().setScope(Location.getHref(), * private void loadScope() {
new AsyncCallback<Boolean>() { * ClientScopeHelper.getService().setScope(Location.getHref(), new
@Override * AsyncCallback<Boolean>() {
public void onSuccess(Boolean result) { *
if (result) { * @Override public void onSuccess(Boolean result) { if (result) {
loadMainPanel(); * loadMainPanel(); } else { UtilsGXT3 .info("Attention",
} else { * "ClientScopeHelper has returned a false value!"); } }
UtilsGXT3 *
.info("Attention", * @Override public void onFailure(Throwable caught) {
"ClientScopeHelper has returned a false value!"); * UtilsGXT3.alert("Error", "Error setting scope: " +
} * caught.getLocalizedMessage()); caught.printStackTrace(); } });
} *
* }
@Override */
public void onFailure(Throwable caught) {
UtilsGXT3.alert("Error", "Error setting scope: "
+ caught.getLocalizedMessage());
caught.printStackTrace();
}
});
}*/
private void loadMainPanel() { private void loadMainPanel() {
dataMinerManagerController = new DataMinerManagerController(); dataMinerManagerController = new DataMinerManagerController();
@ -98,7 +91,7 @@ public class DataMinerManager implements EntryPoint {
bind(); bind();
// Layout // Layout
BorderLayoutContainer mainPanelLayout = new BorderLayoutContainer(); final BorderLayoutContainer mainPanelLayout = new BorderLayoutContainer();
mainPanelLayout.setId("mainPanelLayout"); mainPanelLayout.setId("mainPanelLayout");
mainPanelLayout.setBorders(false); mainPanelLayout.setBorders(false);
mainPanelLayout.setResize(true); mainPanelLayout.setResize(true);
@ -120,21 +113,26 @@ public class DataMinerManager implements EntryPoint {
mainPanelLayout.setNorthWidget(header, menuData); mainPanelLayout.setNorthWidget(header, menuData);
// //
if (dataMinerManagerController.getOperatorId() != null if (dataMinerManagerController.getOperatorId() != null
&& !dataMinerManagerController.getOperatorId().isEmpty()){ && !dataMinerManagerController.getOperatorId().isEmpty()) {
header.setMenu(MenuType.EXPERIMENT); header.setMenu(MenuType.EXPERIMENT);
centerPanel.add(experimentPanel); centerPanel.add(experimentPanel);
previousPanel = experimentPanel; previousPanel = experimentPanel;
} else { } else {
centerPanel.add(homePanel); centerPanel.add(homePanel);
previousPanel = homePanel; previousPanel = homePanel;
} }
bindWindow(mainPanelLayout); bindWindow(mainPanelLayout);
mainPanelLayout.forceLayout();
Scheduler.get().scheduleDeferred(new Command() {
public void execute() {
mainPanelLayout.forceLayout();
}
});
} }