Class sap.ca.ui.CustomerContextModule: sap/ca/ui/CustomerContext

extends Control

This control allows you to open a dialog containing a list of customers for users to pick. The chosen selected customer is persisted using sap.ushell services that shall be fully configured outside of this control.

The dialog can be open following two modes: "select" : exiting without choosing a customer is firing the customerSelected event with a null customer before closing the dialog "change" : exiting without choosing a customer is simply closing the dialog

When opening the dialog in "select" mode, if a customer has been persisted in a previous session, it will be retrieved and the dialog won't open at all.

Deprecated API:Since version 1.24.3. This control is not required anymore as per central UX requirements. Please use Contextual Filter design instead! This control will not be supported anymore.

Constructor Summary
new sap.ca.ui.CustomerContext(sId?, mSettings?)Constructor for a new CustomerContext.
Event Summary
customerSelected(oControlEvent)Fired when a customer is selected in the list.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ca.ui.CustomerContext.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ca.ui.CustomerContext with name sClassName and enriches it with the information contained in oClassInfo.
sap.ca.ui.CustomerContext.getMetadata()Returns a metadata object for class sap.ca.ui.CustomerContext.
attachCustomerSelected(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'customerSelected' event of this sap.ca.ui.CustomerContext.
change()Open the Customer Context dialog
detachCustomerSelected(fnFunction, oListener)Detach event handler fnFunction from the 'customerSelected' event of this sap.ca.ui.CustomerContext.
fireCustomerSelected(mArguments?)Fire event customerSelected to attached listeners.
getCustomerIDProperty()Getter for property customerIDProperty.
getCustomerNameProperty()Getter for property customerNameProperty.
getDialogTitle()Getter for property dialogTitle.
getDistributionChannelNameProperty()Getter for property distributionChannelNameProperty.
getDivisionNameProperty()Getter for property divisionNameProperty.
getPath()Getter for property path.
getPersonalizationPageName()Getter for property personalizationPageName.
getSalesOrganizationNameProperty()Getter for property salesOrganizationNameProperty.
getShowSalesArea()Getter for property showSalesArea.
reset()Delete the user selected customer
select()Open the Customer Context dialog and fires a null customerSelected if the cancel button is clicked
setCustomerIDProperty(sCustomerIDProperty)Setter for property customerIDProperty.
setCustomerNameProperty(sCustomerNameProperty)Setter for property customerNameProperty.
setDialogTitle(sDialogTitle)Setter for property dialogTitle.
setDistributionChannelNameProperty(sDistributionChannelNameProperty)Setter for property distributionChannelNameProperty.
setDivisionNameProperty(sDivisionNameProperty)Setter for property divisionNameProperty.
setModel()Setter for the control model
setPath(sPath)Setter for property path.
setPersonalizationPageName(sPersonalizationPageName)Setter for property personalizationPageName.
setSalesOrganizationNameProperty(sSalesOrganizationNameProperty)Setter for property salesOrganizationNameProperty.
setShowSalesArea(bShowSalesArea)Setter for property showSalesArea.
Constructor Detail
new sap.ca.ui.CustomerContext(sId?, mSettings?)
Constructor for a new CustomerContext.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).

The supported settings are:

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Deprecated:
Since version 1.24.3. This control is not required anymore as per central UX requirements. Please use Contextual Filter design instead! This control will not be supported anymore.
Event Detail
customerSelected(oControlEvent)
Fired when a customer is selected in the list. The fired customer can be empty in case the user press the cancel button while the Customer Context has been open using select()
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.ca.ui.CustomerContext.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ca.ui.CustomerContext with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of informations as described in Element.extend.

Parameters:
{string}sClassName name of the class to be created
{object}oClassInfo? object literal with informations about the class
{function}FNMetaImpl? constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata.
Returns:
{function} the created class / constructor function
sap.ca.ui.CustomerContext.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ca.ui.CustomerContext.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachCustomerSelected(oData?, fnFunction, oListener?): sap.ca.ui.CustomerContext
Attach event handler fnFunction to the 'customerSelected' event of this sap.ca.ui.CustomerContext.
. When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.ca.ui.CustomerContext.
itself.

Fired when a customer is selected in the list. The fired customer can be empty in case the user press the cancel button while the Customer Context has been open using select()

Parameters:
{object}oData? An application specific payload object, that will be passed to the event handler along with the event object when firing the event.
{function}fnFunction The function to call, when the event occurs.
{object}oListener? Context object to call the event handler with. Defaults to this sap.ca.ui.CustomerContext.
itself.
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
change(): void
Open the Customer Context dialog
detachCustomerSelected(fnFunction, oListener): sap.ca.ui.CustomerContext
Detach event handler fnFunction from the 'customerSelected' event of this sap.ca.ui.CustomerContext.

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

Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener Context object on which the given function had to be called.
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
fireCustomerSelected(mArguments?): sap.ca.ui.CustomerContext
Fire event customerSelected to attached listeners.
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
getCustomerIDProperty(): string
Getter for property customerIDProperty. Property name of the customer ID

Default value is CustomerID

Returns:
{string} the value of property customerIDProperty
getCustomerNameProperty(): string
Getter for property customerNameProperty. Property name of the customer name

Default value is CustomerName

Returns:
{string} the value of property customerNameProperty
getDialogTitle(): string
Getter for property dialogTitle. Overrides the default Dialog title

Default value is empty/undefined

Returns:
{string} the value of property dialogTitle
getDistributionChannelNameProperty(): string
Getter for property distributionChannelNameProperty. Property name of the distribution channel name

Default value is DistributionChannelName

Returns:
{string} the value of property distributionChannelNameProperty
getDivisionNameProperty(): string
Getter for property divisionNameProperty. Property name of the division name

Default value is DivisionName

Returns:
{string} the value of property divisionNameProperty
getPath(): string
Getter for property path. Model path to the customer collection to be displayed

Default value is /Customers

Returns:
{string} the value of property path
getPersonalizationPageName(): string
Getter for property personalizationPageName. Name of your app that shall be unique.

Default value is AppCustomerContext

Returns:
{string} the value of property personalizationPageName
getSalesOrganizationNameProperty(): string
Getter for property salesOrganizationNameProperty. Property name of the sales organization name

Default value is SalesOrganizationName

Returns:
{string} the value of property salesOrganizationNameProperty
getShowSalesArea(): boolean
Getter for property showSalesArea. Display or not the customers sales area as well as its name and id.

Default value is false

Returns:
{boolean} the value of property showSalesArea
reset(): void
Delete the user selected customer
select(): void
Open the Customer Context dialog and fires a null customerSelected if the cancel button is clicked
setCustomerIDProperty(sCustomerIDProperty): sap.ca.ui.CustomerContext
Setter for property customerIDProperty.

Default value is CustomerID

Parameters:
{string}sCustomerIDProperty new value for property customerIDProperty
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setCustomerNameProperty(sCustomerNameProperty): sap.ca.ui.CustomerContext
Setter for property customerNameProperty.

Default value is CustomerName

Parameters:
{string}sCustomerNameProperty new value for property customerNameProperty
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setDialogTitle(sDialogTitle): sap.ca.ui.CustomerContext
Setter for property dialogTitle.

Default value is empty/undefined

Parameters:
{string}sDialogTitle new value for property dialogTitle
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setDistributionChannelNameProperty(sDistributionChannelNameProperty): sap.ca.ui.CustomerContext
Setter for property distributionChannelNameProperty.

Default value is DistributionChannelName

Parameters:
{string}sDistributionChannelNameProperty new value for property distributionChannelNameProperty
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setDivisionNameProperty(sDivisionNameProperty): sap.ca.ui.CustomerContext
Setter for property divisionNameProperty.

Default value is DivisionName

Parameters:
{string}sDivisionNameProperty new value for property divisionNameProperty
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setModel(): void
Setter for the control model
setPath(sPath): sap.ca.ui.CustomerContext
Setter for property path.

Default value is /Customers

Parameters:
{string}sPath new value for property path
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setPersonalizationPageName(sPersonalizationPageName): sap.ca.ui.CustomerContext
Setter for property personalizationPageName.

Default value is AppCustomerContext

Parameters:
{string}sPersonalizationPageName new value for property personalizationPageName
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setSalesOrganizationNameProperty(sSalesOrganizationNameProperty): sap.ca.ui.CustomerContext
Setter for property salesOrganizationNameProperty.

Default value is SalesOrganizationName

Parameters:
{string}sSalesOrganizationNameProperty new value for property salesOrganizationNameProperty
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining
setShowSalesArea(bShowSalesArea): sap.ca.ui.CustomerContext
Setter for property showSalesArea.

Default value is false

Parameters:
{boolean}bShowSalesArea new value for property showSalesArea
Returns:
{sap.ca.ui.CustomerContext}this to allow method chaining