Return the debug info about this component.
Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.
Gets the value of a single specific attribute. If no attribute is specified, the method instead returns an object containing all registered attribute key-values.
the specific attribute whose value should be returned.
Gets an object containing all active registered attribute key-values. An attribute is considered active when its value is not in its default state.
Gets the default value of a single specific attribute. If no attribute is specified, the method instead returns an object containing all registered attribute key-default values.
the specific attribute whose default value should be returned.
Gets a string displaying the event namespace followed by the specific event name. The returned string is formatted thus:
[eventNameSpace]:[eventName]
the event name.
Registers a new attribute key-value.
the name of the new attribute to register.
the newly registered attribute default value.
Resets each registered attribute to its default value.
Note: this method calls the setMultiple method without specifying any options.
After the setMultiple
call has returned, this method triggers the reset
event.
Sets the value of a single specific attribute.
Note: this method calls the setMultiple
method.
the specific attribute whose value is to be set.
the value to set the attribute to.
the options (see setMultiple).
Sets a single specific attribute to its default value. Note: this method calls the setMultiple method without specifying any option.
the specific attribute whose value is to be set to its default value.
Sets the values of one or many attributes.
This method may trigger the following events (in order):
• preprocess
• changeOne
• change
• all
the key-value list of attributes with their new intended values.
if the customAttribute
option is set to true
, the method will not validate whether an attribute is registered or not.
If the validateType
option is set to true
, the method will ensure that each value type is correct.
If the silent
option is set to true
, then the changeOne
, change
and all
events will not be triggered.
Sets a new default value to a single specific attribute. Note: specifying a new attribute default value does not set the attribute to that value. This can be done using the setDefault method.
the specific attribute whose default value is to be changed.
the new intended default value.
if the customAttribute
option is set to true
, the method will not validate whether the attribute is registered or not.
The attributes contained in this model. Normally, you should not set attributes directly on this property, as this would prevent required events from being triggered.
A disabled component will not participate in the query, or listen to ComponentEvents.
Allows component to log in the dev console.
The static ID that each component needs in order to be identified.
For example, SearchButton -> static ID: SearchButton -> className: CoveoSearchButton
The event types that can be triggered:
• preprocess
: triggered before a value is set on an attribute. This allows the value to be modified before it is set.
• changeOne
: triggered when a single value changes.
• change
: triggered when one or many values change.
• reset
: triggered when all attributes are reset to their default values.
• all
: triggered after the change
event.
A model is a key-value store that triggers various JavaScript events when any value associated to one of its key changes.
This class is meant to be extended, one of the most important extension being the QueryStateModel class.
Components set values in this key-value store and listen to triggered events in order to update themselves accordingly.