Accessing the "bag" Contract
You can use property bags to persist any key-value pairs in order to store settings for a CHIP instance.
Using property bags, you can persist page settings in the following scopes:
- Personalization: User-specific settings (These settings supersede Customizing and Configuration settings.)
- Customizing: Client-specific settings (These settings supersede Configuration settings, but can be superseded by Personalization settings.)
- Configuration: System-wide settings (These settings can be superseded by Customizing and Personalization settings.)
As a prerequisite, you have to consume the bag contract in the CHIP definition XML.
The bag property is then available in the CHIP API object.
Example:
var oChipApi = this.getView().getViewData().chip,
aBagIds = oChipApi.bag.getBagIds();
oBag = oChipApi.bag.getBag("sample_bag");