public class UserFormula extends DataClass
ListGrid.canAddFormulaFields
behavior.factoryCreated, factoryProperties
Constructor and Description |
---|
UserFormula() |
UserFormula(com.google.gwt.core.client.JavaScriptObject jsObj) |
UserFormula(java.lang.String text) |
UserFormula(java.lang.String text,
java.util.Map formulaVars) |
Modifier and Type | Method and Description |
---|---|
java.util.Map |
getFormulaVars()
Object mapping from variable names to fieldNames.
|
static UserFormula |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getText()
Formula to be evaluated.
|
void |
setFormulaVars(java.util.Map formulaVars)
Object mapping from variable names to fieldNames.
|
void |
setText(java.lang.String text)
Formula to be evaluated.
|
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
public UserFormula()
public UserFormula(com.google.gwt.core.client.JavaScriptObject jsObj)
public UserFormula(java.lang.String text)
public UserFormula(java.lang.String text, java.util.Map formulaVars)
public static UserFormula getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setFormulaVars(java.util.Map formulaVars)
Map vars = new HashMap(); vars.put("E", "population"); vars.put("L", "area");
When used in ListGridField.userFormula
context,
field names are evaluated against the
grid record.
When used in FormItem.formula
or ListGridField.editorFormula
this property is
not used for formula mapping. Instead, field names are evaluated directly against the
current rule context
.
formulaVars
- New formulaVars value. Default value is nullpublic java.util.Map getFormulaVars()
Map vars = new HashMap(); vars.put("E", "population"); vars.put("L", "area");
When used in ListGridField.userFormula
context,
field names are evaluated against the
grid record.
When used in FormItem.formula
or ListGridField.editorFormula
this property is
not used for formula mapping. Instead, field names are evaluated directly against the
current rule context
.
public void setText(java.lang.String text)
There are two contexts where a UserFormula is used: ListGridField.userFormula
and FormItem.formula
or ListGridField.editorFormula
. For the grid field formula
all variables used by the formula must be single-letter capital characters (eg A). These are derived from field values
for the record in question - see formulaVars
.
In
addition to these variables, the keyword record
may be used to refer directly to the record for which the
formula is being displayed.
In the second usage context variables are dot-separated (.) names representing the
nested hierarchy path to the desired value within the rule
context
. No mapping with formulaVars
is needed.
text
- New text value. Default value is nullpublic java.lang.String getText()
There are two contexts where a UserFormula is used: ListGridField.userFormula
and FormItem.formula
or ListGridField.editorFormula
. For the grid field formula
all variables used by the formula must be single-letter capital characters (eg A). These are derived from field values
for the record in question - see formulaVars
.
In
addition to these variables, the keyword record
may be used to refer directly to the record for which the
formula is being displayed.
In the second usage context variables are dot-separated (.) names representing the
nested hierarchy path to the desired value within the rule
context
. No mapping with formulaVars
is needed.