TableItem

class TableItem : CalculateObservable

Table Widget ********************** https://trac.smartms.streamwide.com/wiki/22/Backend_Spec_221/Storage_Template_JSON_Structure#table https://trac.smartms.streamwide.com/wiki/24/Backend_Spec_244/ClientServerProtocol_Table_Calculation#Tablewidget

JSON Structure: { "type": "table", "uuid": "c61398d8-cfa4-4e61-b2f7-5ce26753c9cc", "label": "Single header table", "help": "", "required": false, "maskEmpty": false, "gridLocation": { "rowNumber": 0, "startColumn": 0, "columnSpan": 6 }, "hasValue": true, "unsupportedTypeValue": [], "conditionalDisplay": null, "calculate": null, "conditionalDuplication": null, "visible": true, "useInProcessLabel": false, "autoCaps": 0, "firstColumn": { "number": false, "rows": [] }, "subType": "single", "maxRows": 0, "columns": { "type": "number", "uuid": "ff627312-a0a3-4240-886e-284c51007867", "label": "Number", "help": "", "required": false, "maskEmpty": false, "gridLocation": { "rowNumber": 0, "startColumn": 0, "columnSpan": 6 }, "defaultValue": "0.00", "hasValue": true, "unsupportedTypeValue": "0.00", "conditionalDisplay": null, "calculate": null, "conditionalDuplication": null, "visible": true, "useInProcessLabel": false, "autoCaps": 0, "format": { "decimals": 2, "decPoint": ".", "thousandsSep": "" } }, { "type": "currency", "uuid": "e1a00c4d-a12a-46ff-ae4e-c02846942fe1", "label": "Currency", "help": "", "required": false, "maskEmpty": false, "gridLocation": { "rowNumber": 1, "startColumn": 0, "columnSpan": 6 }, "defaultValue": { "currency": "USD", "value": "" }, "hasValue": true, "unsupportedTypeValue": { "currency": "USD", "value": "" }, "conditionalDisplay": null, "calculate": null, "conditionalDuplication": null, "visible": true, "useInProcessLabel": false, "autoCaps": 0, "modifyCurrency": false, "format": { "decPoint": ".", "thousandsSep": "", "decimals": 2 } }, "footer": [{ "type": "number", "uuid": "5765b5af-4c0c-4b82-93c6-ff3c17955859", "label": "Number", "help": "", "required": false, "maskEmpty": false, "gridLocation": { "rowNumber": 0, "startColumn": 0, "columnSpan": 6 }, "defaultValue": "0.00", "hasValue": true, "unsupportedTypeValue": "0.00", "conditionalDisplay": null, "calculate": { "type": "operand", "valueType": "widget", "value": "", "formula": { "formulaType": "tableColumnSum", "parameters": { "tableUuid": "c61398d8-cfa4-4e61-b2f7-5ce26753c9cc", "columnUuid": "ff627312-a0a3-4240-886e-284c51007867" } } }, "conditionalDuplication": null, "visible": true, "useInProcessLabel": false, "autoCaps": 0, "format": { "decimals": 2, "decPoint": ".", "thousandsSep": "" }, "displayPosition": { "bottomWidgetType": "column", "widgetUuid": "ff627312-a0a3-4240-886e-284c51007867" } }, { "type": "currency", "uuid": "fdad89e6-48aa-47c8-ac6d-db56ef34b42b", "label": "Currency", "help": "", "required": false, "maskEmpty": false, "gridLocation": { "rowNumber": 1, "startColumn": 0, "columnSpan": 6 }, "defaultValue": { "currency": "USD", "value": "" }, "hasValue": true, "unsupportedTypeValue": { "currency": "USD", "value": "" }, "conditionalDisplay": null, "calculate": { "type": "operand", "valueType": "widget", "value": "", "formula": { "formulaType": "tableColumnSum", "parameters": { "tableUuid": "c61398d8-cfa4-4e61-b2f7-5ce26753c9cc", "columnUuid": "e1a00c4d-a12a-46ff-ae4e-c02846942fe1" } } }, "conditionalDuplication": null, "visible": true, "useInProcessLabel": false, "autoCaps": 0, "modifyCurrency": false, "format": { "decPoint": ".", "thousandsSep": "", "decimals": 2 }, "displayPosition": { "bottomWidgetType": "column", "widgetUuid": "e1a00c4d-a12a-46ff-ae4e-c02846942fe1" } }, { "type": "number", "uuid": "f81868ed-bfda-4081-8a95-8de0d802cf4b", "label": "Total", "help": "", "required": false, "maskEmpty": false, "gridLocation": { "rowNumber": 0, "startColumn": 0, "columnSpan": 6 }, "defaultValue": "0.00", "hasValue": true, "unsupportedTypeValue": "0.00", "conditionalDisplay": null, "calculate": { "type": "operand", "valueType": "widget", "value": "5765b5af-4c0c-4b82-93c6-ff3c17955859" }, { "type": "operator", "value": "ADD" }, { "type": "operand", "valueType": "widget", "value": "fdad89e6-48aa-47c8-ac6d-db56ef34b42b" } , "conditionalDuplication": null, "visible": true, "useInProcessLabel": false, "autoCaps": 0, "format": { "decimals": 2, "decPoint": ".", "thousandsSep": "" }, "displayPosition": { "bottomWidgetType": "table", "widgetUuid": null } } ] }

Constructors

Link copied to clipboard
fun TableItem(    json: JSONObject,     displayMode: Int,     processUUID: String?)
Link copied to clipboard
fun TableItem(parcel: Parcel)

Types

Link copied to clipboard
object CREATOR : Parcelable.Creator<TableItem>

Properties

Link copied to clipboard
val calculateSubscribers: <ERROR CLASS>
Link copied to clipboard
lateinit val columns: JSONArray
Link copied to clipboard
val footer: JSONArray? = null
Link copied to clipboard
var footerItemList: <ERROR CLASS><WidgetItem>
Link copied to clipboard
val maxRows: Int = 0
Link copied to clipboard
val number: Boolean = false
Link copied to clipboard
lateinit val rows: <ERROR CLASS><String>
Link copied to clipboard
lateinit val subType: String
Link copied to clipboard
val widgetsItemList: LiveData<<ERROR CLASS><<ERROR CLASS><WidgetItem>>>

Inherited properties

Link copied to clipboard
val blacklistedWidgets: <ERROR CLASS><String>? = null
Link copied to clipboard
var blockRange: Int = 0
Link copied to clipboard
val bottomWidgetType: String? = null
Link copied to clipboard
val columnSpan: Int = 2
Link copied to clipboard
val conditionalDisplay: ConditionalDisplayItem? = null
Link copied to clipboard
val currentVisibility: StateFlow<Boolean>
Link copied to clipboard
val displayMode: Int
Link copied to clipboard
val displayModeLiveData: LiveData<Int>
Link copied to clipboard
val displayPositionUUID: String? = null
Link copied to clipboard
val help: String
Link copied to clipboard
val isConditionalDuplicationEnabled: Boolean = false
Link copied to clipboard
val isRequired: Boolean = false
Link copied to clipboard
val isUsedInProcessLabel: Boolean = false
Link copied to clipboard
val isVisible: Boolean = false
Link copied to clipboard
val label: String
Link copied to clipboard
val maskEmpty: Boolean = false
Link copied to clipboard
var processUUID: String? = null
Link copied to clipboard
val rowNumber: Int = 0
Link copied to clipboard
val startColumn: Int = 0
Link copied to clipboard
lateinit val type: String
Link copied to clipboard
lateinit val uuid: String
Link copied to clipboard
val validationState: LiveData<WidgetResult.ResultStatus>

Functions

Link copied to clipboard
fun addRow(count: Int = 1)
Link copied to clipboard
open override fun extractData(): JSONArray

extract data from all fields of a widget.

Link copied to clipboard
open override fun extractDataForExternalDB(): Any?
Link copied to clipboard
fun extractFooterData(): JSONObject?
Link copied to clipboard
open override fun getStringValue(context: Context): String?
Link copied to clipboard
open override fun getSubWidgetItem(widgetUUID: String?): WidgetItem?
Link copied to clipboard
open override fun getValueCurrencyTypeWidgetByUuid(): Pair<String, String>
Link copied to clipboard
open override fun haveChanges(): Boolean
Link copied to clipboard
open override fun isValidValue(mode: Int): Boolean
Link copied to clipboard
open override fun parseData(data: String, saveData: Boolean)
Link copied to clipboard
fun publishSumUp(columnUUID: String?)
Link copied to clipboard
open override fun publishValues()
Link copied to clipboard
open override fun putDataFromExternalDB(data: String?)
Link copied to clipboard
open override fun refreshCalculateWidget()
Link copied to clipboard
open override fun registerSubscriber(    isDivAuthorized: Boolean,     subWidgetUUID: String?,     calculateObserver: CalculateObserver)

add calculateObserver to List of calculateObservers

Link copied to clipboard
fun removeRow(groupPosition: Int)
Link copied to clipboard
open override fun resetValues()
Link copied to clipboard
open override fun saveChanges()
Link copied to clipboard
fun setFooterData(footerValues: String?)
Link copied to clipboard
open override fun writeToParcel(parcel: Parcel, flags: Int)

Inherited functions

Link copied to clipboard
open override fun describeContents(): Int
Link copied to clipboard
fun getConditionalDisplayUUIDs(): List<String>?
Link copied to clipboard
open fun getTypeAndSubType(): String
Link copied to clipboard
fun haveSubscribers(): Boolean
Link copied to clipboard
fun isRoot(): Boolean
Link copied to clipboard
open override fun onDataChanged(    widgetUUID: String?,     tempValue: String?,     data: Any?)
Link copied to clipboard
open override fun onParentVisibilityChanged(widgetUUID: String, isVisible: Boolean)

call back when Parent widget Visibility Changed need to set the parent visibility and recalculate the validity of the widget

Link copied to clipboard
fun publishCalculateWidgetValue(    uuid: String,     value: String,     currencyType: String?)

notify all calculateObservers by value changes

Link copied to clipboard
fun publishData(value: String, data: Any?)

notify all subscribers when data changed on the widget

Link copied to clipboard
open fun publishVisibility(isVisible: Boolean)

update the visibility status and notify all subscribers about the visibility of the widget

Link copied to clipboard
fun setConditionalDisplayType(uuid: String, type: String)
Link copied to clipboard
fun setType(mType: String)
Link copied to clipboard
fun setUuid(mUuid: String)
Link copied to clipboard
fun subscribe(widgetListener: ConditionalDisplayListener)

called from the activity to add teh callback as subscriber note:subscribers is a Set so we don't need to test if the callback already exist

Link copied to clipboard
fun unregisterSubscriber(calculateObserver: CalculateObserver)

remove calculateObserver from List of calculateObservers

Link copied to clipboard
fun validate(isFullValidation: Boolean): WidgetResult
Link copied to clipboard
open override fun writeToParcel(bundle: Bundle): Bundle