use of org.activityinfo.client.report.view.ReportView in project activityinfo by bedatadriven.
the class ReportPortlet method onModelLoad.
private void onModelLoad(ReportDTO dto) {
Report report = dto.getReport();
if (report.getElements().isEmpty()) {
removeAll();
add(new Label("The report is empty"));
return;
}
final ReportElement element = report.getElement(0);
final ReportView view = createView(element);
if (view == null) {
removeAll();
add(new Label("Unsupport report type"));
layout();
return;
}
dispatcher.execute(new GenerateElement<Content>(element), new AsyncCallback<Content>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(Content result) {
element.setContent(result);
view.show(element);
removeAll();
add(view.asComponent());
layout();
}
});
}
Aggregations