This class represents the parameters for a pluggable part of BlueConic
(e.g. an Insight or Interaction plugin).
It should not be instantiated by a developer, but is automatically injected in a plugin.
Example
// @formatter:off
define([
"dojo/_base/declare",
"blueconic/api/widgets/plugins/_BaseInsight"
// @formatter:on
], function(declare, _BaseInsight) {
return declare("your.package.insightwidget", [_BaseInsight],
{
// Injected by BlueConic
parameters: null,
postCreate: function(){
this.inherited(arguments);
// retrieve single value
var paramValue = this.parameters.getValue("myKey");
// retrieve multiple values
var paramValues = this.parameters.getValues("myArrayKey");
if (!paramValue) {
// set single value
this.parameters.setValue("myKey", "myValue");
}
if (!paramValues) {
// set multiple values
this.parameters.setValues("myArrayKey", ["myValue1", "myValue2"]);
}
}
});
});
Properties
-
readonly RELATIONTYPE String
-
All possible values for the relation type.
Properties:
Name Description PARENT CHILD HAS USED_BY SETS RELATED
Functions
-
getIds()Array.<String>
-
Returns all id's of the values in this object.
Returns:
Type Description Array.<String> The id's. -
getValue(id)Object
-
Returns the value of the parameter specified by the id. If there are multiple values, only the first value will be returned.
Name Type Description id String The id of the parameter.
Returns:
Type Description Object The value object associated with the parameter. -
getValues(id)Array.<Object>
-
Returns all values of the parameter specified by the id.
Name Type Description id String The id of the parameter.
Returns:
Type Description Array.<Object> The value(s) object associated with the parameter. -
setValue(id, value)
-
Set value for a given parameter id.
Name Type Description id String Id of the parameter.
value Object The value object.
-
setValues(id, values)
-
Set values for a given parameter id.
Name Type Description id String Id of the parameter.
values Array.<Object> The values array. Values can be of any type (String, Number, Object).
Events
-
onChange(isCancel)
-
Called when this parameter object changes.
Name Type Description isCancel boolean Whether the change is caused by a cancel.
-
onContentChange()
-
Should be thrown by the plugin developer using this instance to indicate that there are changes in one of the parameters of type "html". This automatically updates the InlineEditor with the given content.