The order entry page is probably the most complex one of the whole demo application. It not only extends the standard file maintenance but also provides a grid for the entry of order lines.
Basically we setup the lines in the grid with built in computations so that when the user changes the quantity ordered, the grid itself, locally on the workstation computes the price, tax amount and total weight. This all done locally inside the browser by the calc=xxxx option in the grid line definitions.
When you enter a product code into a row on the grid, the system sends an event to the server to fill in both visible and hidden cells in the grid. These values along with the calculations allow the grid to then compute line and invoice totals as the user changes the quantity ordered. It even has a hidden field with the most recent quantity in hand so it can estimate if stock exists and adjust shipping qty versus back order quantity.
For example the grid cell which contains the price extension (qty*price) has the following option:
calc="(dtl_grid:ItemsOrdered==0 ? 1 : dtl_grid:ItemsShipped)*dtl_grid:AdjPrice"
This means the extended price is computed by multiplying the Items shipped (or 1 if Ordercount is omitted) times the price.
Having these computations done locally on the page Webster can reduce the number of requests needed in the server providing the ability to handle more users with better response times.
There are also events tied to invoice header fields such as ship from location, currency, and client price list so that if these change the grid values get updated.