iText 8.0.5 API
iText.Forms.Form.Element.ListBoxField Class Reference

A field that represents a control for selecting one or several of the provided options. More...

Inheritance diagram for iText.Forms.Form.Element.ListBoxField:
iText.Forms.Form.Element.AbstractSelectField iText.Forms.Form.Element.FormField< iText.Forms.Form.Element.AbstractSelectField >

Public Member Functions

  ListBoxField (String id, int size, bool allowMultipleSelection)
  Create a new list box field. More...
 
override T1  GetDefaultProperty< T1 > (int property)
 
virtual iText.Forms.Form.Element.ListBoxField  AddOption (String option)
  Add an option for ListBoxField. More...
 
virtual iText.Forms.Form.Element.ListBoxField  AddOption (String option, bool selected)
  Add an option for ListBoxField. More...
 
virtual IList< String >  GetSelectedStrings ()
  Get a list of selected options. More...
 
override AccessibilityProperties  GetAccessibilityProperties ()
  Gets the accessibility properties. More...
 
- Public Member Functions inherited from iText.Forms.Form.Element.AbstractSelectField
virtual void  AddOption (IBlockElement optionElement)
  Add a container with options. More...
 
virtual void  AddOption (SelectFieldItem option)
  Add an option to the element. More...
 
virtual void  AddOption (SelectFieldItem option, bool selected)
  Add an option to the element. More...
 
virtual IList< SelectFieldItem GetItems ()
  Get a list of SelectFieldItem. More...
 
virtual int  OptionsCount ()
  Gets the total amount of options available. More...
 
virtual bool  HasOptions ()
  Checks if the element has any options. More...
 
virtual SelectFieldItem  GetOption (String value)
  Get an option SelectFieldItem by its string value. More...
 
virtual IList< IBlockElement GetOptions ()
  Gets a list of containers with option(s). More...
 
virtual bool  HasExportAndDisplayValues ()
  Checks if the field has options with export and display values. More...
 
- Public Member Functions inherited from iText.Forms.Form.Element.FormField< iText.Forms.Form.Element.AbstractSelectField >
virtual T  SetSize (float size)
  Sets the form field's width and height. More...
 
virtual IFormField  SetWidth (float width)
 
virtual IFormField  SetHeight (float height)
 
virtual IFormField  SetValue (String value)
 
virtual String  GetId ()
 
override T1  GetDefaultProperty< T1 > (int property)
 
virtual IFormField  SetInteractive (bool interactive)
 

Protected Member Functions

override IRenderer  MakeNewRenderer ()
 

Additional Inherited Members

- Package Functions inherited from iText.Forms.Form.Element.AbstractSelectField
  AbstractSelectField (String id)
  Instantiates a new AbstractSelectField instance. More...
 
- Package Attributes inherited from iText.Forms.Form.Element.AbstractSelectField
IList< SelectFieldItem options = new List<SelectFieldItem>()
 
- Package Attributes inherited from iText.Forms.Form.Element.FormField< iText.Forms.Form.Element.AbstractSelectField >
DefaultAccessibilityProperties  tagProperties
  The tag properties. More...
 

Detailed Description

A field that represents a control for selecting one or several of the provided options.

Constructor & Destructor Documentation

◆ ListBoxField()

iText.Forms.Form.Element.ListBoxField.ListBoxField ( String  id,
int  size,
bool  allowMultipleSelection 
)
inline

Create a new list box field.

Parameters
size the size of the list box, which will define the height of visible properties, shall be greater than zero
allowMultipleSelection a boolean flag that defines whether multiple options are allowed to be selected at once
id the id

Member Function Documentation

◆ AddOption() [1/2]

virtual iText.Forms.Form.Element.ListBoxField iText.Forms.Form.Element.ListBoxField.AddOption ( String  option )
inlinevirtual

Add an option for ListBoxField.

Add an option for ListBoxField . The option is not selected.

Parameters
option string representation of the option.
Returns
this ListBoxField.

◆ AddOption() [2/2]

virtual iText.Forms.Form.Element.ListBoxField iText.Forms.Form.Element.ListBoxField.AddOption ( String  option,
bool  selected 
)
inlinevirtual

Add an option for ListBoxField.

Parameters
option string representation of the option.
selected

true is the option if selected, false otherwise.

Returns
this ListBoxField.

◆ GetAccessibilityProperties()

override AccessibilityProperties iText.Forms.Form.Element.ListBoxField.GetAccessibilityProperties ( )
inlinevirtual

◆ GetSelectedStrings()

virtual IList iText.Forms.Form.Element.ListBoxField.GetSelectedStrings ( )
inlinevirtual

Get a list of selected options.

Returns
a list of display values of selected options.