Skip to main content

FormField Class

Serves as the base class for PDF form fields.

Declaration

public abstract class FormField extends JavaObject implements ICloneable

Remarks

The following code snippet iterates through all form fields and prints their names and types:

// Iterate through all form fields in the document, including grouped fields.
for (FormField field : pdfDocument.getFields().toFlatIterable()) {
    System.out.println(field.getName());
    System.out.println(field.getClass().getSimpleName());
}

Refer to the following help topics for additional information:

Implements

com.devexpress.system.ICloneable

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
com.devexpress.system.JavaObject
FormField

Methods

clone(DocumentCloneContext context) Method

Creates a copy of this form field in the specified clone context.

Declaration

public FormField clone(DocumentCloneContext context)

Parameters

Name Type Description
context DocumentCloneContext

The context used to clone document objects.

Returns

Type Description
FormField

A copy of this form field.

deepClone() Method

Creates a deep copy of this form field.

Declaration

public FormField deepClone()

Returns

Type Description
FormField

A deep copy of this form field.

getActions() Method

Returns JavaScript actions associated with this form field.

Declaration

public FormFieldActions getActions()

Returns

Type Description
FormFieldActions

JavaScript actions associated with this form field.

getAlternateName() Method

Returns the alternate name of this form field.

Declaration

public String getAlternateName()

Returns

Type Description
String

The alternate name of this form field.

getName() Method

Returns the name of this form field.

Declaration

public String getName()

Returns

Type Description
String

The name of this form field.

getReadOnly() Method

Returns whether this form field is read-only.

Declaration

public boolean getReadOnly()

Returns

Type Description
boolean

true if this form field is read-only; otherwise, false.

getRequired() Method

Returns whether this form field is required.

Declaration

public boolean getRequired()

Returns

Type Description
boolean

true if this form field is required; otherwise, false.

objectClone() Method

Creates a copy of this form field as an object.

Declaration

public Object objectClone()

Returns

Type Description
Object

A copy of this form field.

setActions(FormFieldActions value) Method

Sets JavaScript actions associated with this form field.

Declaration

public void setActions(FormFieldActions value)

Parameters

Name Type Description
value FormFieldActions

JavaScript actions associated with this form field.

setAlternateName(String value) Method

Sets the alternate name of this form field.

Declaration

public void setAlternateName(String value)

Parameters

Name Type Description
value String

The alternate name of this form field.

setName(String value) Method

the name of this form field.

Declaration

public void setName(String value)

Parameters

Name Type Description
value String

The form field name.

Remarks

Tip

Use the PdfDocument.getFieldNameCollisions() method to identify form fields with the same name before you merge or manipulate them.

Refer to the following help topic for additional information: Resolve Merge Conflicts.

setReadOnly(boolean value) Method

Sets whether this form field is read-only.

Declaration

public void setReadOnly(boolean value)

Parameters

Name Type Description
value boolean

true to make this form field read-only; otherwise, false.

setRequired(boolean value) Method

Sets whether this form field is required.

Declaration

public void setRequired(boolean value)

Parameters

Name Type Description
value boolean

true to mark this form field as required; otherwise, false.