Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@94970 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-04-17 12:54:54 +00:00 committed by Giancarlo Panichi
parent 79d978ae4b
commit bfc947448f
2 changed files with 51 additions and 5 deletions

View File

@ -71,7 +71,6 @@ public class HistoryPanel extends FramedPanel {
super();
this.eventBus = eventBus;
forceLayoutOnResize = true;
retrieveCurrentTR();
}

View File

@ -55,16 +55,31 @@ public class ValidationsTablePanel extends FramedPanel {
protected ListStore<Validations> storeValidations;
protected ListLoader<ListLoadConfig, ListLoadResult<Validations>> loader;
protected Grid<Validations> grid;
private boolean drawed;
public ValidationsTablePanel(EventBus eventBus) {
super();
this.eventBus = eventBus;
forceLayoutOnResize = true;
retrieveCurrentTR();
}
public ValidationsTablePanel(TRId trId, EventBus eventBus) {
super();
this.trId = trId;
this.eventBus = eventBus;
forceLayoutOnResize = true;
draw();
}
protected void draw() {
drawed = true;
init();
create();
}
protected void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
@ -205,9 +220,41 @@ public class ValidationsTablePanel extends FramedPanel {
}
public void update(TRId trId) {
this.trId = trId;
public void update() {
retrieveCurrentTR();
loader.load();
}
public void update(TRId trId) {
this.trId=trId;
loader.load();
}
protected void retrieveCurrentTR() {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
public void onSuccess(TRId result) {
Log.debug("retrieved " + result);
trId = result;
if (!drawed) {
draw();
}
}
});
}
}