Package ro.fortsoft.wicket.pivot.web

Examples of ro.fortsoft.wicket.pivot.web.FieldCalculationPanel$OnChangeAjaxBehaviorExtension


    private static final long serialVersionUID = 1L;

    private void openFieldCalculationDialog(final AjaxLink<Void> ajaxLink, AjaxRequestTarget target) {
      ModalWindow modal = ajaxLink.findParent(PivotAreaPanel.class).getModal();
      modal.setTitle("Calculation");
      final FieldCalculationPanel panel = new FieldCalculationPanel(modal.getContentId(), Model.of(field),
          Model.of(pivotModel));
      panel.setTitle(field.getTitle());
      panel.add(AttributeModifier.append("style", "padding: 10px;"));
      modal.setContent(panel);
      modal.setAutoSize(true);
      modal.setResizable(false);
      modal.show(target);
      modal.setWindowClosedCallback(new WindowClosedCallback() {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(AjaxRequestTarget target) {
          if (!panel.isOkPressed()) {
            return;
          }

          target.add(ajaxLink.findParent(PivotAreaPanel.class));

          PivotModel pivotModel = getPivotModel(ajaxLink);
          PivotField pivotField = pivotModel.getField(field.getName());
          pivotField.setFieldCalculation(panel.getFieldCalculation());
          pivotField.setTitle(panel.getTitle());
          if (pivotModel.isAutoCalculate()) {
            ajaxLink.findParent(PivotPanel.class).compute(target);
          }
        }
      });
View Full Code Here

TOP

Related Classes of ro.fortsoft.wicket.pivot.web.FieldCalculationPanel$OnChangeAjaxBehaviorExtension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.