panels JavaScript API
Use the clmContext.panels API to interact with the custom panels.
Summary
Types |
---|
Types
CustomPanel
Properties | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
string | panelName | Unique name for the panel. | ||||||||||||
string | location | Location where the panel is embedded. It will be one of LOCATION_CHECKOUT, LOCATION_OFFERING, or LOCATION_OFFERING_RESOURCESET. | ||||||||||||
boolean | isValid | Indicates whether the data in this panel is valid. The CLMUI console looks at this flag to enable or disable buttons such as Add to Cart and Submit. Custom panel code should set this flag based on the validity of the values that the user enters. The default value is true. | ||||||||||||
static string | LOCATION_CHECKOUT | Custom panel on the Cart Checkout page. Defined as "cart.checkout". | ||||||||||||
static string | LOCATION_OFFERING | Custom panel at the offering level on the Catalog (or request) details page. Defined as "catalog.offering". | ||||||||||||
static string | LOCATION_OFFERING_RESOURCESET | Custom panel at the resource set or server group level on the Catalog (or request) details page. Defined as "catalog.offering.servergroup". | ||||||||||||
Methods | ||||||||||||||
void | addEventListener | clmContext.panels.CustomPanel.addEventListener(string eventName,function callback) Example projectInfoPanel.addEventListener("onLoad", projectInfoPanelOnLoadListener); projectInfoPanel is an instance of one of the CustomPanel subclasses.
| ||||||||||||
Events | ||||||||||||||
| onLoad | This event is executed when the custom panel is loaded in the console. Example Register for the event: panelObj.addEventListener("onLoad",myPanelOnLoadListener); panelObj is the panel reference passed to the entry point function.(% style="color: rgb(0,0,0);" %) Callback function: myPanelOnLoadListener = function(event) {...} The event object passed to the callback function will have the following properties:
If the panel is displayed in the Request Details page or the Cart Checkout page, the detail of the event will have a property called customFieldsNameValueMap, which is a map of the name and value of the custom fields. Use that to initialize the custom fields of the panel. |
RequestCustomPanel
RequestCustomPanel extends and CustomPanel represents a panel added in the Request Details page. The location property is LOCATION_OFFERING or LOCATION_OFFERING_RESOURCESET.
Properties | ||
---|---|---|
See the inherited properties from CustomPanel. | ||
Methods | ||
See the inherited properties from CustomPanel. | ||
Events | ||
See the inherited properties from CustomPanel. |
CheckoutCustomPanel
CheckoutCustomPanel extends and CustomPanel represents a panel added in the Cart Checkout page. The location property is LOCATION_CHECKOUT.
Properties | ||
---|---|---|
See the inherited properties from CustomPanel. | ||
Methods | ||
See the inherited properties from CustomPanel. | ||
Events | ||
See the inherited properties from CustomPanel. |