Validates whether at least one facet is currently active (has selected or excluded values) in the interface.
true if at least one facet is active; false otherwise.
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.
Creates a new QueryStateModel instance.
The HTMLElement on which to instantiate the QueryStateModel.
The state key-value store to instantiate the QueryStateModel with.
The
QueryStateModelclass is a key-value store which contains the current state of the components that can affect the query (see State). This class inherits from theModelclass. Optionally, it is possible to persist the state in the query string in order to enable browser history management (see theHistoryControllerclass).Components set values in the
QueryStateModelinstance to reflect their current state. TheQueryStateModeltriggers state events (seeeventTypes) whenever one of its values is modified. Components listen to triggered state events to update themselves when appropriate.For instance, when a query is triggered, the
Searchboxcomponent sets theqattribute (the basic query expression), while thePagercomponent sets thefirstattribute (the index of the first result to display in the result list), and so on.Example:
Note: