Package com.smartgwt.client.widgets

# Class UserSummary

java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.widgets.UserSummary

All Implemented Interfaces:
  `HasHandlers`

public class UserSummary extends DataClass
An object representing a user-created summary.

`ListGrid`s additionally allow the summary to be user-modifiable, with the summary created and edited with a SummaryBuilder, either directly or via the `ListGrid.canAddSummaryFields` behavior.

See Also:
  - `FieldGeneration overview and related methods`

- ## Field Summary

  ### Fields inherited from class com.smartgwt.client.core.DataClass

  `factoryCreated, factoryProperties`

  ### Fields inherited from class com.smartgwt.client.core.JsObject

  `jsObj`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UserSummary()`
  `UserSummary(JavaScriptObject jsObj)`
  `UserSummary(String text)`
  `UserSummary(String text, Map summaryVars)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static UserSummary`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `Map`
  `getSummaryVars()`
  Map from the single capital letters used as summary variables in the `UserSummary` String to the field names these variables should represent.
  `String`
  `getText()`
  Summary to be evaluated.
  `UserSummary`
  `setSummaryVars(Map summaryVars)`
  Map from the single capital letters used as summary variables in the `UserSummary` String to the field names these variables should represent.
  `UserSummary`
  `setText(String text)`
  Summary to be evaluated.

  ### Methods inherited from class com.smartgwt.client.core.DataClass

  `applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, 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`

  ### Methods inherited from class com.smartgwt.client.core.JsObject

  `equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### UserSummary

    public UserSummary()

  - ### UserSummary

    public UserSummary(JavaScriptObject jsObj)

  - ### UserSummary

    public UserSummary(String text)

  - ### UserSummary

    public UserSummary(String text, Map summaryVars)

- ## Method Details

  - ### getOrCreateRef

    public static UserSummary getOrCreateRef(JavaScriptObject jsObj)

  - ### setSummaryVars

    public UserSummary setSummaryVars(Map summaryVars)
    Map from the single capital letters used as summary variables in the `UserSummary` String to the field names these variables should represent.

    When used in the context of grid or detail viewer fields, field names are evaluated against the record.

    Summaries built by a SummaryBuilder for a `ListGrid` will normally not define this property and the field names will be used directly, unless useSingleLetterKey is `true`. This property is also not used for summary mapping in `FormItem.textFormula` or `ListGridField.editorTextFormula`. Instead, field names are evaluated directly against the current `rule context`.

    Parameters:
      `summaryVars` - New summaryVars value. Default value is null
    Returns:
      `UserSummary` instance, for chaining setter calls

  - ### getSummaryVars

    public Map getSummaryVars()
    Map from the single capital letters used as summary variables in the `UserSummary` String to the field names these variables should represent.

    When used in the context of grid or detail viewer fields, field names are evaluated against the record.

    Summaries built by a SummaryBuilder for a `ListGrid` will normally not define this property and the field names will be used directly, unless useSingleLetterKey is `true`. This property is also not used for summary mapping in `FormItem.textFormula` or `ListGridField.editorTextFormula`. Instead, field names are evaluated directly against the current `rule context`.

    Returns:
      Current summaryVars value. Default value is null

  - ### setText

    public UserSummary setText(String text)
    Summary to be evaluated.

    There are two contexts where a `UserSummary` is used: `ListGridField.userSummary` / `DetailViewerField.userSummary` and `FormItem.textFormula` or `ListGridField.editorTextFormula`. For the grid/detail viewer field summary, all variables used by the summary must be single capital letters surrounded by braces and escaped with a # sign (e.g. #{A}). These are derived from field values for the record in question - see `summaryVars`.

    In the context of forms and editing, variables are dot-separated (.) names representing the nested hierarchy path to the desired value within the `rule context`. No mapping with `summaryVars` is needed.

    This attribute is writable only in `ListGrid`s. Applications must call either `ListGrid.setUserSummary()` or `ListGrid.setUserSummaryText()` to re-evaluate the summary.

    Parameters:
      `text` - New text value. Default value is null
    Returns:
      `UserSummary` instance, for chaining setter calls

  - ### getText

    public String getText()
    Summary to be evaluated.

    There are two contexts where a `UserSummary` is used: `ListGridField.userSummary` / `DetailViewerField.userSummary` and `FormItem.textFormula` or `ListGridField.editorTextFormula`. For the grid/detail viewer field summary, all variables used by the summary must be single capital letters surrounded by braces and escaped with a # sign (e.g. #{A}). These are derived from field values for the record in question - see `summaryVars`.

    In the context of forms and editing, variables are dot-separated (.) names representing the nested hierarchy path to the desired value within the `rule context`. No mapping with `summaryVars` is needed.

    This attribute is writable only in `ListGrid`s. Applications must call either `ListGrid.setUserSummary()` or `ListGrid.setUserSummaryText()` to re-evaluate the summary.

    Returns:
      Current text value. Default value is null