Search Results for

    Show / Hide Table of Contents

    Class MultiSelectListView

    • C#
    • Visual Basic
    public sealed class MultiSelectListView : AbstractView
    Public NotInheritable Class MultiSelectListView
        Inherits AbstractView
    Inheritance
    System.Object
    AbstractView
    MultiSelectListView
    Inherited Members
    AbstractView.Id
    AbstractView.Name
    AbstractView.Type
    AbstractView.HtmlIndent
    AbstractView.NonAllowedCharactersForId
    AbstractView.GetIndentStringFromNumber(Int32)
    AbstractView.IdContainsNonAllowedCharacters()
    AbstractView.ShallowCopy()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: HomeSeer.Jui.Views
    Assembly: PluginSdk.dll


    A selection list allows a user to pick multiple values from a predefined collection.


    Constructors

    View Source

    MultiSelectListView(String, String, List<String>, List<String>, EMultiSelectListType, List<Int32>)

    Create a new instance of a multi select list with the default, drop down style, an ID, Name, and the specified list of options and keys

    Declaration
    • C#
    • Visual Basic
    [JsonConstructor]
    public MultiSelectListView(string id, string name, List<string> options, List<string> optionKeys, EMultiSelectListType style = EMultiSelectListType.DropDown, List<int> selection = null)
    <JsonConstructor>
    Public Sub New(id As String, name As String, options As List(Of String), optionKeys As List(Of String), style As EMultiSelectListType = EMultiSelectListType.DropDown, selection As List(Of Integer) = Nothing)
    Parameters
    Type Name Description
    System.String id

    The unique ID for this View

    System.String name

    The name of the view

    System.Collections.Generic.List<System.String> options

    The list of options

    System.Collections.Generic.List<System.String> optionKeys

    The list of keys corresponding to the list of options

    EMultiSelectListType style

    The display style of the select list. DEFAULT: drop down

    System.Collections.Generic.List<System.Int32> selection

    The list of indexes of the currently selected options in the list. DEFAULT: null

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if multi select list is create with an invalid list of options or option keys

    System.ArgumentOutOfRangeException

    Thrown if multi select list is created with invalid indexes for the currently selected options

    View Source

    MultiSelectListView(String, String, List<String>, List<String>, EMultiSelectListType, List<String>)

    Create a new instance of a multi select list with the default, drop down style, an ID, Name, and the specified list of options and keys

    Declaration
    • C#
    • Visual Basic
    public MultiSelectListView(string id, string name, List<string> options, List<string> optionKeys, EMultiSelectListType style = EMultiSelectListType.DropDown, List<string> selectedKeys = null)
    Public Sub New(id As String, name As String, options As List(Of String), optionKeys As List(Of String), style As EMultiSelectListType = EMultiSelectListType.DropDown, selectedKeys As List(Of String) = Nothing)
    Parameters
    Type Name Description
    System.String id

    The unique ID for this View

    System.String name

    The name of the view

    System.Collections.Generic.List<System.String> options

    The list of options

    System.Collections.Generic.List<System.String> optionKeys

    The list of keys corresponding to the list of options

    EMultiSelectListType style

    The display style of the select list. DEFAULT: drop down

    System.Collections.Generic.List<System.String> selectedKeys

    The list of selected option keys

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if multi select list is create with an invalid list of options or option keys

    Fields

    View Source

    _selection

    Declaration
    • C#
    • Visual Basic
    List<int> _selection
    _selection As List(Of Integer)
    Field Value
    Type Description
    System.Collections.Generic.List<System.Int32>

    Properties

    View Source

    DefaultSelectionText

    The text displayed when Selection equals null or an emptyl List. If this property is null or empty, "Select options" is displayed.

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("default_selection_text")]
    public string DefaultSelectionText { get; set; }
    <JsonProperty("default_selection_text")>
    Public Property DefaultSelectionText As String
    Property Value
    Type Description
    System.String
    View Source

    OptionKeys

    A list of keys that corresponds to the Options list.

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("keys")]
    public List<string> OptionKeys { get; }
    <JsonProperty("keys")>
    Public ReadOnly Property OptionKeys As List(Of String)
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>
    View Source

    Options

    A list of options that the user can select from

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("options")]
    public List<string> Options { get; }
    <JsonProperty("options")>
    Public ReadOnly Property Options As List(Of String)
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>
    View Source

    Selection

    The indexes of the currently selected options in the list. This is the value for this view.

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("selection")]
    public List<int> Selection { get; set; }
    <JsonProperty("selection")>
    Public Property Selection As List(Of Integer)
    Property Value
    Type Description
    System.Collections.Generic.List<System.Int32>
    Remarks

    Set this to null or an emptyl List to display a default "Select an option" text

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown when the selection is set to an index that does not work for the current Options

    View Source

    Style

    The display style for the list of options

    Declaration
    • C#
    • Visual Basic
    [JsonProperty("style")]
    public EMultiSelectListType Style { get; set; }
    <JsonProperty("style")>
    Public Property Style As EMultiSelectListType
    Property Value
    Type Description
    EMultiSelectListType

    Methods

    View Source

    GetSelectedOptionKeys()

    Get the currently selected option keys

    Declaration
    • C#
    • Visual Basic
    public List<string> GetSelectedOptionKeys()
    Public Function GetSelectedOptionKeys As List(Of String)
    Returns
    Type Description
    System.Collections.Generic.List<System.String>

    The list of keys of the option at the indexes specified by Selection.

    View Source

    GetSelectedOptions()

    Get the currently selected options.

    Declaration
    • C#
    • Visual Basic
    public List<string> GetSelectedOptions()
    Public Function GetSelectedOptions As List(Of String)
    Returns
    Type Description
    System.Collections.Generic.List<System.String>

    The list of the options at the indexes specified by Selection.

    View Source

    GetStringValue()

    Get the value associated with this view as a string if there is one.

    Declaration
    • C#
    • Visual Basic
    public override string GetStringValue()
    Public Overrides Function GetStringValue As String
    Returns
    Type Description
    System.String

    The value stored in this view as a string or NULL if there is no value stored.

    Overrides
    AbstractView.GetStringValue()
    Remarks

    Returns a comma separated list of selected option keys

    View Source

    ToHtml(Int32)

    Get a string representation of this view converted into HTML

    Declaration
    • C#
    • Visual Basic
    public override string ToHtml(int indent = 0)
    Public Overrides Function ToHtml(indent As Integer = 0) As String
    Parameters
    Type Name Description
    System.Int32 indent
    Returns
    Type Description
    System.String

    An HTML representation of the view as a string

    Overrides
    AbstractView.ToHtml(Int32)
    View Source

    Update(AbstractView)

    Update the view to the new state. This will change the selected options

    Declaration
    • C#
    • Visual Basic
    public override void Update(AbstractView newViewState)
    Public Overrides Sub Update(newViewState As AbstractView)
    Parameters
    Type Name Description
    AbstractView newViewState

    The new state of the view being updated. This view's ID and Type must match the calling view exactly

    Overrides
    AbstractView.Update(AbstractView)
    Exceptions
    Type Condition
    ViewTypeMismatchException

    Thrown when the new view's class doesn't match the calling view

    View Source

    UpdateValue(String)

    Update the value of the view

    Declaration
    • C#
    • Visual Basic
    public override void UpdateValue(string value)
    Public Overrides Sub UpdateValue(value As String)
    Parameters
    Type Name Description
    System.String value

    The new value

    Overrides
    AbstractView.UpdateValue(String)
    • View Source
    In This Article
    Back to top HomeSeer Technologies