Table of Contents

Class AbstractSelectField

Namespace
iText.Forms.Form.Element
Assembly
itext.forms.dll

An abstract class for fields that represents a control for selecting one or several of the provided options.

public abstract class AbstractSelectField : FormField<AbstractSelectField>, IFormField, IBlockElement, IAbstractElement, IElement, IPropertyContainer, IAccessibleElement
Inheritance
AbstractSelectField
Implements
Derived
Inherited Members

Constructors

AbstractSelectField(string)

Instantiates a new AbstractSelectField instance.

protected AbstractSelectField(string id)

Parameters

id string

the id of the field

Fields

options

protected IList<SelectFieldItem> options

Field Value

IList<SelectFieldItem>

Methods

AddOption(SelectFieldItem)

Add an option to the element.

public virtual void AddOption(SelectFieldItem option)

Parameters

option SelectFieldItem

a SelectFieldItem

AddOption(SelectFieldItem, bool)

Add an option to the element.

public virtual void AddOption(SelectFieldItem option, bool selected)

Parameters

option SelectFieldItem

a SelectFieldItem

selected bool

true is the option if selected, false otherwise

AddOption(IBlockElement)

Add a container with options.

[Obsolete("starting from 8.0.1.")]
public virtual void AddOption(IBlockElement optionElement)

Parameters

optionElement IBlockElement

a container with options

Remarks

Add a container with options. This might be a container for options group.

GetItems()

Get a list of SelectFieldItem.

public virtual IList<SelectFieldItem> GetItems()

Returns

IList<SelectFieldItem>

a list of options.

GetOption(string)

Get an option SelectFieldItem by its string value.

public virtual SelectFieldItem GetOption(string value)

Parameters

value string

string value to find an option by

Returns

SelectFieldItem

a SelectFieldItem.

GetOptions()

Gets a list of containers with option(s).

[Obsolete("starting from 8.0.1.")]
public virtual IList<IBlockElement> GetOptions()

Returns

IList<IBlockElement>

a list of containers with options.

Remarks

Gets a list of containers with option(s). Every container might be a container for options group.

HasExportAndDisplayValues()

Checks if the field has options with export and display values.

public virtual bool HasExportAndDisplayValues()

Returns

bool

true if the field has options with export and display values, false otherwise.

HasOptions()

Checks if the element has any options.

public virtual bool HasOptions()

Returns

bool

true if the element has options, false otherwise.

OptionsCount()

Gets the total amount of options available.

public virtual int OptionsCount()

Returns

int

the number of options in the element.