use of org.activityinfo.ui.client.formulaDialog.FormulaDialog in project activityinfo by bedatadriven.
the class MeasurePane method editFormula.
private void editFormula(MeasureModel measure) {
FormulaDialog dialog = new FormulaDialog(viewModel.getFormStore(), measure.getFormId());
dialog.show(measure.getFormula(), formula -> {
updateMeasureFormula(measure, formula.getFormula());
});
}
use of org.activityinfo.ui.client.formulaDialog.FormulaDialog in project activityinfo by bedatadriven.
the class MeasureDialog method onCalculate.
private void onCalculate(SelectEvent event) {
ResourceId selectedFormId = model.getSelectedForms().getList().get(0);
FormulaDialog dialog = new FormulaDialog(model.getFormStore(), selectedFormId);
dialog.show(null, expr -> {
ImmutableMeasureModel measure = ImmutableMeasureModel.builder().formId(selectedFormId).formula(expr.getFormula()).label(expr.getFormula()).addStatistics(Statistic.SUM).build();
select(measure);
});
}
Aggregations