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.
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
. 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
. reset()Delete the user selected customer select()Open the Customer Context dialog and fires a null customerSelected if the cancel button is clicked setPath(sPath)Setter for property path
. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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:
- Properties
- Aggregations
- Associations
- Events
- customerSelected : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
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:
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 |
Returns a metadata object for class sap.ca.ui.CustomerContext.
Returns:
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:
change(): void
Open the Customer Context dialog
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:
Fire event customerSelected to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
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
Setter for property
customerIDProperty
.
Default value is CustomerID
Parameters:
{string} | sCustomerIDProperty | new value for property customerIDProperty |
Returns:
Setter for property
customerNameProperty
.
Default value is CustomerName
Parameters:
{string} | sCustomerNameProperty | new value for property customerNameProperty |
Returns:
Setter for property
dialogTitle
.
Default value is empty/undefined
Parameters:
{string} | sDialogTitle | new value for property dialogTitle |
Returns:
Setter for property
distributionChannelNameProperty
.
Default value is DistributionChannelName
Parameters:
{string} | sDistributionChannelNameProperty | new value for property distributionChannelNameProperty |
Returns:
Setter for property
divisionNameProperty
.
Default value is DivisionName
Parameters:
{string} | sDivisionNameProperty | new value for property divisionNameProperty |
Returns:
setModel(): void
Setter for the control model
Setter for property
path
.
Default value is /Customers
Parameters:
{string} | sPath | new value for property path |
Returns:
Setter for property
personalizationPageName
.
Default value is AppCustomerContext
Parameters:
{string} | sPersonalizationPageName | new value for property personalizationPageName |
Returns:
Setter for property
salesOrganizationNameProperty
.
Default value is SalesOrganizationName
Parameters:
{string} | sSalesOrganizationNameProperty | new value for property salesOrganizationNameProperty |
Returns:
Setter for property
showSalesArea
.
Default value is false
Parameters:
{boolean} | bShowSalesArea | new value for property showSalesArea |
Returns: