Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
borderColorgreen
borderWidth1
titleBGColor#ddffcc
borderStylesolid
titleDefinition

Calculation Field allows you to perform a series of arithmetic computations to a set or a series of fields.

Image Removed

Figure 1: Screenshot highlighting Calculation Field taken from sample HR Expenses Claim app

“计算字段”  允许您对一组或一系列字段执行一系列算术计算。

Image Added

1:截屏突出显示计算领域从样本人力资源费用索赔应用程序

Screenshots taken from http://localhost:8080/jw/web/console/app/hr_expense/1/form/builder/hr_expense_claim

Figure 2: Calculation Field Properties图2:计算字段属性

NameDescription
IDElement ID (By declaring as "total", a corresponding database table column "c_total" will be created)元素ID(通过声明为“total”,将创建相应的数据库表列“c_total”)
Label元素标签显示给最终用户。LabelElement Label to be displayed to end user.
Variables
NameDescription
Variable NameDeclare a name to store current row equation result.
Field ID

Form Field ID to retrieve.

In the example above, we are summing at a specific column from a Form Grid.

Form Grid ID: entries

Column in Form Grid: formattedAmount

Field ID to be filled in: entries.formattedAmount

变量名声明一个名称来存储当前的行方程结果。
字段ID

形式字段ID来检索。

在上面的例子中,我们从表格网格中的特定列进行求和。

表单网格IDentries

表单网格中的列:formattedAmount

要填写的字段ID:entries.formattedAmount

多值操作Multivalue Operation
  • Sum
  • Avg
  • Min
  • Max
EquationArithmetic operation using the variables declared above.使用上面声明的变量进行算术运算。

 

Figure 3: Calculation Field Properties - Advanced Options图3:计算字段属性 - 高级选项

NameDescription
Validator

Attach a Validator plugin to validate the input value.附加一个Validator插件来验证输入值。

Info
titleWhen will validation takes place?

Validation will takes place whenever form is submitted except when it is submitted as "Save as Draft".除非提交表格为“另存为草稿”,否则将在提交表格时进行验证。

Formatting Style
    US Style Formatting (1
    • 美式格式(1,000.
  • 00)European Formatting (1
    • 00)
    • 欧洲格式(1.000,
  • 00)
    • 00)
Number of DecimalNumber of Decimal十进制数
PrefixPrefix of the calculated value计算值的前缀
PostfixPostix of the calculated value计算值的Postix
Use Thousand Separator?Thousand Separator toggle.千位分隔符切换。
Hidden?Shows this element to the end user.将此元素显示给最终用户。
Display as Label?Displays the value of the element as plain text.以纯文本形式显示元素的值。
Workflow Variable

If the form is part of a workflow process, upon saving of the form (by clicking on "Save as Draft" or "Complete" button). The value in this input field will be saved into the corresponding workflow variable named here.如果表单是工作流程的一部分,则在保存表单时(单击“另存为草稿”或“完成”按钮)。此输入字段中的值将被保存到相应的名为here的工作流程变量中。

Info
titleUsing a non-existent Workflow Variable name

You will get the following warning with the name printed out (e.g. status) in the server log if you attempt to map to a non-existent Workflow Variable.如果尝试映射到不存在的工作流程变量,则会在服务器日志中输出以下警告(例如状态)。

Code Block
context attribute status does not exist in process context - adding new attributes to the process context is not allowed


...