class sap.m.P13nConditionPanel

Control sample: sap.m.P13nConditionPanel
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/P13nConditionPanel
Application Component: CA-UI5-CTR

The ConditionPanel Control will be used to implement the Sorting, Filtering and Grouping panel of the new Personalization dialog.


Constructor

Constructor for a new P13nConditionPanel.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.m.P13nConditionPanel(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
alwaysShowAddIcon boolean true

makes the Add icon visible on each condition row. If is set to false the Add is only visible at the end and you can only append a new condition.

Visibility: public
autoAddNewRow boolean false

adds initial a new empty condition row

Visibility: public
autoReduceKeyFieldItems boolean false

KeyField value can only be selected once. When you set the property to true the ConditionPanel will automatically offers on the KeyField drop down only the keyFields which are not used. The default behavior is that in each keyField dropdown all keyfields are listed.

Visibility: public
containerQuery boolean false

defines if the mediaQuery or a ContainerResize will be used for layout update. When the P13nConditionPanel is used on a dialog the property should be set to true!

Visibility: public
disableFirstRemoveIcon boolean false

makes the remove icon on the first condition row disabled when only one condition exist.

Visibility: public
displayFormat string

This represents the displayFormat of the condition Values. With the value "UpperCase" the entered value of the condition will be converted to upperCase.

Visibility: public
exclude boolean false

exclude options for filter

Visibility: public
layoutMode string

can be used to control the layout behavior. Default is "" which will automatically change the layout. With "Desktop", "Table" or "Phone" you can set a fixed layout.

Visibility: public
maxConditions string -1

defines the max number of conditions on the ConditionPanel

Visibility: public
showLabel boolean false

show additional labels in the condition

Visibility: public
usePrevConditionSetting boolean true

new added condition use the settings from the previous condition as default.

Visibility: public
validationExecutor object

Calls the validation listener tbd...

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
content 0..n sap.ui.core.Control

Content for the ConditionPanel. This aggregation is not public!


Events Overview

Event Description
dataChange

Workaround for updating the binding

dataChange

Workaround for updating the binding

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addCondition

add a single condition.

addKeyField

add a single KeyField

addOperation

add a single operation

attachDataChange

Attaches event handler fnFunction to the dataChange event of this sap.m.P13nConditionPanel.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.P13nConditionPanel itself.

Workaround for updating the binding

detachDataChange

Detaches event handler fnFunction from the dataChange event of this sap.m.P13nConditionPanel.

The passed function and listener object must match the ones used for event registration.

sap.m.P13nConditionPanel.extend

Creates a new subclass of class sap.m.P13nConditionPanel with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

fireDataChange

Fires event dataChange to attached listeners.

getAlwaysShowAddIcon

Gets current value of property alwaysShowAddIcon.

makes the Add icon visible on each condition row. If is set to false the Add is only visible at the end and you can only append a new condition.

Default value is true.

getAutoAddNewRow

Gets current value of property autoAddNewRow.

adds initial a new empty condition row

Default value is false.

getAutoReduceKeyFieldItems

Gets current value of property autoReduceKeyFieldItems.

KeyField value can only be selected once. When you set the property to true the ConditionPanel will automatically offers on the KeyField drop down only the keyFields which are not used. The default behavior is that in each keyField dropdown all keyfields are listed.

Default value is false.

getConditions

returns array of all defined conditions.

getContainerQuery

Gets current value of property containerQuery.

defines if the mediaQuery or a ContainerResize will be used for layout update. When the P13nConditionPanel is used on a dialog the property should be set to true!

Default value is false.

getDisableFirstRemoveIcon

Gets current value of property disableFirstRemoveIcon.

makes the remove icon on the first condition row disabled when only one condition exist.

Default value is false.

getDisplayFormat

Gets current value of property displayFormat.

This represents the displayFormat of the condition Values. With the value "UpperCase" the entered value of the condition will be converted to upperCase.

getExclude

Gets current value of property exclude.

exclude options for filter

Default value is false.

sap.m.P13nConditionPanel.getFormatedConditionText

creates and returns a formatted text for the specified condition

getKeyFields

getter for KeyFields array

getLayoutMode

Gets current value of property layoutMode.

can be used to control the layout behavior. Default is "" which will automatically change the layout. With "Desktop", "Table" or "Phone" you can set a fixed layout.

getMaxConditions

Gets current value of property maxConditions.

defines the max number of conditions on the ConditionPanel

Default value is '-1'.

sap.m.P13nConditionPanel.getMetadata

Returns a metadata object for class sap.m.P13nConditionPanel.

getOperations

returns the default array of operations

getShowLabel

Gets current value of property showLabel.

show additional labels in the condition

Default value is false.

getUsePrevConditionSetting

Gets current value of property usePrevConditionSetting.

new added condition use the settings from the previous condition as default.

Default value is true.

getValidationExecutor

Gets current value of property validationExecutor.

Calls the validation listener tbd...

insertCondition

insert a single condition.

removeAllConditions

remove all conditions.

removeAllKeyFields

removes all KeyFields

removeAllOperations

remove all operations

removeCondition

remove a single condition.

removeInvalidConditions

removes all invalid conditions.

removeValidationErrors

removes all errors/warning states from the value1/2 fields of all conditions.

setAutoAddNewRow

Sets a new value for property autoAddNewRow.

adds initial a new empty condition row

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setAutoReduceKeyFieldItems

Sets a new value for property autoReduceKeyFieldItems.

KeyField value can only be selected once. When you set the property to true the ConditionPanel will automatically offers on the KeyField drop down only the keyFields which are not used. The default behavior is that in each keyField dropdown all keyfields are listed.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setConditions

This method must be used to assign a list of conditions.

setDisableFirstRemoveIcon

Sets a new value for property disableFirstRemoveIcon.

makes the remove icon on the first condition row disabled when only one condition exist.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setDisplayFormat

Sets a new value for property displayFormat.

This represents the displayFormat of the condition Values. With the value "UpperCase" the entered value of the condition will be converted to upperCase.

When called with a value of null or undefined, the default value of the property will be restored.

setExclude

Sets a new value for property exclude.

exclude options for filter

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setKeyFields

This method allows you to specify the KeyFields for the conditions. You can set an array of object with Key and Text properties to define the keyfields.

setMaxConditions

Sets a new value for property maxConditions.

defines the max number of conditions on the ConditionPanel

When called with a value of null or undefined, the default value of the property will be restored.

Default value is '-1'.

setOperations

setter for the supported operations which we show per condition row. This array of "default" operations will only be used when we do not have on the keyfield itself some specific operations and a keyfield is of not of type date or numeric.

setShowLabel

Sets a new value for property showLabel.

show additional labels in the condition

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

setUsePrevConditionSetting

Sets a new value for property usePrevConditionSetting.

new added condition use the settings from the previous condition as default.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

setValidationExecutor

Sets a new value for property validationExecutor.

Calls the validation listener tbd...

When called with a value of null or undefined, the default value of the property will be restored.

addCondition

add a single condition.

Param Type DefaultValue Description
oCondition object

the new condition of type { "key": "007", "operation": sap.m.P13nConditionOperation.Ascending, "keyField": "keyFieldKey", "value1": "", "value2": ""};

addKeyField

add a single KeyField

Param Type DefaultValue Description
oKeyField object

{key: "CompanyCode", text: "ID"}

addOperation

add a single operation

Param Type DefaultValue Description
oOperation sap.m.P13nConditionOperation
sType string

defines the type for which this operations will be used.

attachDataChange

Attaches event handler fnFunction to the dataChange event of this sap.m.P13nConditionPanel.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.P13nConditionPanel itself.

Workaround for updating the binding

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.P13nConditionPanel itself

detachDataChange

Detaches event handler fnFunction from the dataChange event of this sap.m.P13nConditionPanel.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.m.P13nConditionPanel.extend

Creates a new subclass of class sap.m.P13nConditionPanel with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

fireDataChange

Fires event dataChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAlwaysShowAddIcon

Gets current value of property alwaysShowAddIcon.

makes the Add icon visible on each condition row. If is set to false the Add is only visible at the end and you can only append a new condition.

Default value is true.

getAutoAddNewRow

Gets current value of property autoAddNewRow.

adds initial a new empty condition row

Default value is false.

getAutoReduceKeyFieldItems

Gets current value of property autoReduceKeyFieldItems.

KeyField value can only be selected once. When you set the property to true the ConditionPanel will automatically offers on the KeyField drop down only the keyFields which are not used. The default behavior is that in each keyField dropdown all keyfields are listed.

Default value is false.

getConditions

returns array of all defined conditions.

getContainerQuery

Gets current value of property containerQuery.

defines if the mediaQuery or a ContainerResize will be used for layout update. When the P13nConditionPanel is used on a dialog the property should be set to true!

Default value is false.

getDisableFirstRemoveIcon

Gets current value of property disableFirstRemoveIcon.

makes the remove icon on the first condition row disabled when only one condition exist.

Default value is false.

getDisplayFormat

Gets current value of property displayFormat.

This represents the displayFormat of the condition Values. With the value "UpperCase" the entered value of the condition will be converted to upperCase.

getExclude

Gets current value of property exclude.

exclude options for filter

Default value is false.

sap.m.P13nConditionPanel.getFormatedConditionText

creates and returns a formatted text for the specified condition

Param Type DefaultValue Description
sOperation string

the operation type sap.m.P13nConditionOperation

sValue1 string

value of the first range field

sValue2 string

value of the second range field

bExclude boolean

indicates if the range is an Exclude range

getKeyFields

getter for KeyFields array

getLayoutMode

Gets current value of property layoutMode.

can be used to control the layout behavior. Default is "" which will automatically change the layout. With "Desktop", "Table" or "Phone" you can set a fixed layout.

getMaxConditions

Gets current value of property maxConditions.

defines the max number of conditions on the ConditionPanel

Default value is '-1'.

sap.m.P13nConditionPanel.getMetadata

Returns a metadata object for class sap.m.P13nConditionPanel.

getOperations

returns the default array of operations

Param Type DefaultValue Description
sType string default

defines the type for which the operations should be returned.

getShowLabel

Gets current value of property showLabel.

show additional labels in the condition

Default value is false.

getUsePrevConditionSetting

Gets current value of property usePrevConditionSetting.

new added condition use the settings from the previous condition as default.

Default value is true.

getValidationExecutor

Gets current value of property validationExecutor.

Calls the validation listener tbd...

insertCondition

insert a single condition.

Param Type DefaultValue Description
oCondition object

the new condition of type { "key": "007", "operation": sap.m.P13nConditionOperation.Ascending, "keyField": "keyFieldKey", "value1": "", "value2": ""};

index int

of the new condition

removeAllConditions

remove all conditions.

removeAllKeyFields

removes all KeyFields

removeAllOperations

remove all operations

Param Type DefaultValue Description
sType string

defines the type for which all operations should be removed

removeCondition

remove a single condition.

Param Type DefaultValue Description
vCondition object

is the condition which should be removed. can be either a string with the key of the condition of the condition object itself.

removeInvalidConditions

removes all invalid conditions.

removeValidationErrors

removes all errors/warning states from the value1/2 fields of all conditions.

setAutoAddNewRow

Sets a new value for property autoAddNewRow.

adds initial a new empty condition row

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bAutoAddNewRow boolean false

New value for property autoAddNewRow

setAutoReduceKeyFieldItems

Sets a new value for property autoReduceKeyFieldItems.

KeyField value can only be selected once. When you set the property to true the ConditionPanel will automatically offers on the KeyField drop down only the keyFields which are not used. The default behavior is that in each keyField dropdown all keyfields are listed.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bAutoReduceKeyFieldItems boolean false

New value for property autoReduceKeyFieldItems

setConditions

This method must be used to assign a list of conditions.

Param Type DefaultValue Description
aConditions object[]

array of Conditions.

setDisableFirstRemoveIcon

Sets a new value for property disableFirstRemoveIcon.

makes the remove icon on the first condition row disabled when only one condition exist.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bDisableFirstRemoveIcon boolean false

New value for property disableFirstRemoveIcon

setDisplayFormat

Sets a new value for property displayFormat.

This represents the displayFormat of the condition Values. With the value "UpperCase" the entered value of the condition will be converted to upperCase.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sDisplayFormat string

New value for property displayFormat

setExclude

Sets a new value for property exclude.

exclude options for filter

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bExclude boolean false

New value for property exclude

setKeyFields

This method allows you to specify the KeyFields for the conditions. You can set an array of object with Key and Text properties to define the keyfields.

Param Type DefaultValue Description
aKeyFields array

array of KeyFields [{key: "CompanyCode", text: "ID"}, {key:"CompanyName", text : "Name"}]

setMaxConditions

Sets a new value for property maxConditions.

defines the max number of conditions on the ConditionPanel

When called with a value of null or undefined, the default value of the property will be restored.

Default value is '-1'.

Param Type DefaultValue Description
sMaxConditions string '-1'

New value for property maxConditions

setOperations

setter for the supported operations which we show per condition row. This array of "default" operations will only be used when we do not have on the keyfield itself some specific operations and a keyfield is of not of type date or numeric.

Param Type DefaultValue Description
aOperations sap.m.P13nConditionOperation[]

array of operations [sap.m.P13nConditionOperation.BT, sap.m.P13nConditionOperation.EQ]

sType string

defines the type for which this operations will be used. is sType is not defined the operations will be used as default operations.

setShowLabel

Sets a new value for property showLabel.

show additional labels in the condition

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Param Type DefaultValue Description
bShowLabel boolean false

New value for property showLabel

setUsePrevConditionSetting

Sets a new value for property usePrevConditionSetting.

new added condition use the settings from the previous condition as default.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Param Type DefaultValue Description
bUsePrevConditionSetting boolean true

New value for property usePrevConditionSetting

setValidationExecutor

Sets a new value for property validationExecutor.

Calls the validation listener tbd...

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
oValidationExecutor object

New value for property validationExecutor