Package ro.fortsoft.wicket.pivot

Examples of ro.fortsoft.wicket.pivot.PivotModel


  @Override
  protected void onInitialize() {
    super.onInitialize();

    PivotModel pivotModel = getModelObject();
    PivotTableRenderModel renderModel =  PivotTableRenderModel.create(pivotModel);

    // rendering header
    RepeatingView column = new RepeatingView("header");
    add(column);
View Full Code Here


      private static final long serialVersionUID = 1L;

      @Override
      public void onSort(AjaxRequestTarget target, Item[] items) {
        PivotModel pivotModel = getPivotModel();
        for (Item item : items) {
          PivotField pivotField = pivotModel.getField(item.fieldIndex);
          pivotField.setArea(PivotField.Area.getValue(item.areaName));
          pivotField.setAreaIndex(item.sortIndex);
        }
        send(getPage(), Broadcast.BREADTH, new AreaChangedEvent(target));
      }
View Full Code Here

      target.add(downloadContainer);
    }
  }

  protected PivotModel createPivotModel(PivotDataSource pivotDataSource) {
    PivotModel pivotModel = new DefaultPivotModel(pivotDataSource);

    // debug
    /*
     * Tree columnsHeaderTree = pivotModel.getColumnsHeaderTree();
     * System.out.println("### Columns Header Tree ###");
View Full Code Here

      private static final long serialVersionUID = 1L;

      @Override
      protected PivotModel createPivotModel(PivotDataSource pivotDataSource) {
        PivotModel pivotModel = super.createPivotModel(pivotDataSource);

        // add some fields on some area
        pivotModel.getField("REGION").setArea(PivotField.Area.ROW);
        pivotModel.getField("SALESMAN").setArea(PivotField.Area.ROW).setAreaIndex(1);
        pivotModel.getField("YEAR").setArea(PivotField.Area.COLUMN);
        pivotModel.getField("MONTH").setArea(PivotField.Area.COLUMN).setAreaIndex(1);
        pivotModel.getField("SALES").setArea(PivotField.Area.DATA);

        // set an aggregator for a data pivot field
//        pivotModel.getField("SALES").setAggregator(new Aggregator.Count());
       
        // set a custom converter for a pivot field
        /*
        pivotModel.getField("SALES").setConverter(new DoubleConverter() {

          private static final long serialVersionUID = 1L;

          @Override
          public NumberFormat getNumberFormat(Locale locale) {
            NumberFormat format = super.getNumberFormat(locale);
            format.setMinimumFractionDigits(2);
           
            return format;
          }
         
        });
        */
       
        // show grand totals
        pivotModel.setShowGrandTotalForColumn(true);
        pivotModel.setShowGrandTotalForRow(true);

        return pivotModel;
      }

    };
View Full Code Here

TOP

Related Classes of ro.fortsoft.wicket.pivot.PivotModel

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.