Click or drag to resize
Facets Class
Class for creating a facets argument, used for check-box navigation. It also has support for parsing and toggling facet values, so it can be used to keep track of selection changes. Note that Facets are immutable and all methods return new Facets objects.
Inheritance Hierarchy
SystemObject
  Apptus.ESales.ConnectorFacets

Namespace:  Apptus.ESales.Connector
Assembly:  Apptus.Esales.ConnectorApi (in Apptus.Esales.ConnectorApi.dll) Version: 4.5.0
Syntax
C#
public class Facets

The Facets type exposes the following members.

Constructors
Methods
  NameDescription
Public methodAdd(String, IEnumerableString)
Return a new Facets with the given attribute and values added.
Public methodAdd(String, String)
Return a new Facets with the given attribute and values added.
Public methodAddRange
Return a new Facets with the given attribute range added. If a range of the current attribute already existed, it will replace the existing one. Note that facet ranges are inclusive.
Public methodEquals (Overrides ObjectEquals(Object).)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Overrides ObjectGetHashCode.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberParse
Create a Facets object from the source string.
Public methodRemove
Return a new Facets with the given attribute removed.
Public methodToggle
Toggle the given attribute and value.
Public methodToString
Builds and returns a string on the facet argument format.
(Overrides ObjectToString.)
Top
Examples
Examples:
Facets f = new Facets("color", "yellow", "blue").Add("brand", "nike");
// f.ToString() is: brand:nike,color:blue|yellow
ArgMap panelArguments = new ArgMap();
panelArguments.Add("facets", f);
// ... other arguments...
If it is convenient for your scenario you can serialize the current selected values using
ToString()
and store them in the browser. When a check-box is clicked, deserialize it afterwards like this:
Facets f = Facets.Parse(facetsString);
Then update it with the last click and send a new request:
f = f.Toggle(clickedAttribute, clickedValue);
panelArguments.Add("facets", f);
// ... add other arguments and send request...
See Also