use of org.activityinfo.shared.command.result.HtmlResult in project activityinfo by bedatadriven.
the class RenderReportHtmlHandler method execute.
@Override
@LogException
public CommandResult execute(RenderReportHtml cmd, User user) throws CommandException {
ReportElement model = cmd.getModel();
LOGGER.fine("Model: " + model);
// don't show the title: it will be rendered by the container
model.setTitle(null);
generator.generateElement(user, model, new Filter(), new DateRange());
StringWriter writer = new StringWriter();
try {
renderer.render(model, writer);
} catch (IOException e) {
throw new CommandException(e);
}
return new HtmlResult(writer.toString());
}
use of org.activityinfo.shared.command.result.HtmlResult in project activityinfo by bedatadriven.
the class ElementWidget method loadHtml.
private void loadHtml() {
contentElement.setInnerHTML("");
loadingElement.getStyle().setDisplay(Display.BLOCK);
if (model instanceof TextReportElement) {
renderStaticHtml();
} else {
dispatcher.execute(new RenderReportHtml(model), new AsyncCallback<HtmlResult>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(HtmlResult result) {
updateHtml(result.getHtml());
}
});
}
}
Aggregations