Totals Calculation

Totals Calculation


To implement this feature it is necessary to inherit from the ability to List Totals, which is done via the triple:

MyEntity is a Ability.ListTotals.

This will inherit a view 'TotalAttributes' which will be added any field(s) that need to be totaled.

Plex

For this example we will use the entity OrderDetail.

The inheritance would be defined like this:

OrderProcessing.OrderDetail is a ENT Ability.ListTotals.


After inheriting from ListTotals observer that the entity OrderDetail has a new view named Total Attributes.


In the Total Attribute view choose a field(s) found on the grid to calculate its total. In this example we will use two fields from the grid: Quantity and Derived Line Total.


Generate Changes.

For the test Model there is an OrderProcessingbuildObjects list object that contains all the template generation functions for all the entities of the application:


After generating the OrderProcessingbuildObjects list generate the ApplicationServerObject which is a list of all the server objects required for the HSYNC application:


Eclipse

Now go to eclipse.

To import all the generated functions right click and refresh the java project:


Then run the Application Generator:


When the application is running do the following:

  1. Click on Application Settings then on Apply:

  2. Click on Application Template, select Gen Folder, and Generate Application. Wait for the message that all was generated successfully:

Now right click and refresh the web project.


Run tomcat server:


Test Changes

Observe that the calculated fields are correctly displayed with the right amounts



    • Related Articles

    • Provide a Method to Calculate Values for Derived Attributes

      Plex This example will use the entity OrderDetail where a derived field will be added. Enter the following triple: OrderProcessing.OrderDetail has a derived FLD LineTotal. Generate Changes. On the test Model there is an OrderProcessingbuildObjects ...
    • Clone Detection Web Interface

      Our Clone Detection Summary page provides a % of Clones statistic in a speedometer presentation with a cost calculator below. Enter your estimated cost per line of code for maintenance each year and we will calculate your potential savings when you ...
    • Resizable Panels Using Fixed Positioning

      Introduction WebClient includes a feature called FixedPositioning that can be used to make panel functions auto resizable according to the user’s screen. This works by using the values of Fix, Size and Position properties of each control in the ...
    • Incident Reporter for Web

      Video Walkthrough Pattern Functions All functions will be under "Patterns.Web". GoogleMap This pattern is a simple UIBasicShell.  It displays a single field: GoogleMap for GoogleMap.  This field has a Control Name of ...
    • Incident Reporter for Mobile

      Video Walkthrough Pattern Functions All functions will be under "Patterns.Mobile". CordovaPage This function inherits from ~WebShell, and has an IMPL Name of Cordova.  Any function inheriting from this will use the Cordova-page.ctrl template.  This ...