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

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

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

Public Member Functions

  ComboBoxField (String id)
  Creates a new select field box. More...
 
virtual String  GetSelectedExportValue ()
  Gets the export value of the selected option. More...
 
virtual iText.Forms.Form.Element.ComboBoxField  SetSelected (int index)
  Selects an option by its index. More...
 
virtual iText.Forms.Form.Element.ComboBoxField  SetSelected (String value)
  Selects an option by its export value. More...
 
virtual iText.Forms.Form.Element.ComboBoxField  SetSelected (SelectFieldItem item)
  Selects an option by its value. More...
 
override void  AddOption (SelectFieldItem option)
  Add an option to the element. More...
 
virtual SelectFieldItem  GetSelectedOption ()
  Gets the selected option. 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, 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 of the provided options.

Constructor & Destructor Documentation

◆ ComboBoxField()

iText.Forms.Form.Element.ComboBoxField.ComboBoxField ( String  id )
inline

Creates a new select field box.

Parameters
id the id

Member Function Documentation

◆ AddOption()

override void iText.Forms.Form.Element.ComboBoxField.AddOption ( SelectFieldItem  option )
inlinevirtual

Add an option to the element.

Parameters
option a SelectFieldItem.

Reimplemented from iText.Forms.Form.Element.AbstractSelectField.

◆ GetAccessibilityProperties()

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

◆ GetSelectedExportValue()

virtual String iText.Forms.Form.Element.ComboBoxField.GetSelectedExportValue ( )
inlinevirtual

Gets the export value of the selected option.

Returns
the export value of the selected option. This may be null if no value has been selected.

◆ GetSelectedOption()

virtual SelectFieldItem iText.Forms.Form.Element.ComboBoxField.GetSelectedOption ( )
inlinevirtual

Gets the selected option.

Returns
the selected option. This may be null if no option has been selected.

◆ SetSelected() [1/3]

virtual iText.Forms.Form.Element.ComboBoxField iText.Forms.Form.Element.ComboBoxField.SetSelected ( int  index )
inlinevirtual

Selects an option by its index.

Selects an option by its index. The index is zero-based.

Parameters
index the index of the option to select.
Returns
this ComboBoxField instance.

◆ SetSelected() [2/3]

virtual iText.Forms.Form.Element.ComboBoxField iText.Forms.Form.Element.ComboBoxField.SetSelected ( SelectFieldItem  item )
inlinevirtual

Selects an option by its value.

Selects an option by its value. This will use the export value of the option to match it to existing options.

Parameters
item the option to select.
Returns
this ComboBoxField instance.

◆ SetSelected() [3/3]

virtual iText.Forms.Form.Element.ComboBoxField iText.Forms.Form.Element.ComboBoxField.SetSelected ( String  value )
inlinevirtual

Selects an option by its export value.

Parameters
value the export value of the option to select.
Returns
this ComboBoxField instance.