Interface PhoneField<F extends PhoneField<F>>

All Superinterfaces:
Comparable<F>, Component<F>, Copyable<F>, Field<F>, FormComponent<F>, Serializable
All Known Implementing Classes:
DefaultPhoneField

public interface PhoneField<F extends PhoneField<F>> extends Field<F>

Represents the metadata for a FieldTypes.PHONE field. A phone field is useful for situations when you are managing a phone property.

A dynamic field can be used to switch between one field type and another, for example:

 Fields.phone()
         .placeholderCountryCode("1");
 
Author:
Bongani Mbigi (bongani-m)
  • Method Details

    • includeCountryCode

      default F includeCountryCode()
      Include the country code input for this phone field. This input is used to manage the countryCode property on the phone. Defaults to true. Use excludeCountryCode() to exclude this input ex. the number +1 (555) 555-5555 would include the field to enter 1 as the area code. which the result would be an object like: { countryCode: '1', phoneNumber: '5555555555' }
      Returns:
      this
    • includeExtension

      default F includeExtension()
      Include the country code input for this phone field. This input is used to manage the extension property on the phone. Defaults to true. Use excludeExtension() to exclude this input ex. the number +1 (555) 555-5555 ext. 123 would include the field to enter 123 as the extension. which the result would be an object like: { extension: '123', phoneNumber: '5555555555' }
      Returns:
      this
    • excludeCountryCode

      default F excludeCountryCode()
      Excludes the country code input for this phone field. Sets countryCode attribute to false. Use includeCountryCode() to include this input ex. the number +1 (555) 555-5555 would NOT include the field to enter 1 as the area code. which the result would be an object like: { phoneNumber: '5555555555' }
      Returns:
      this
    • excludeExtension

      default F excludeExtension()
      Excludes the extension input for this phone field. Sets extension attribute to false. Use includeExtension() to include this input ex. the number +1 (555) 555-5555 ext. 123 would NOT include the field to enter 123 as the extension. which the result would be an object like: { phoneNumber: '5555555555' }
      Returns:
      this
    • placeholderCountryCode

      default F placeholderCountryCode(String placeholder)
      Configures the the field to have the placeholder with the desired country code ex. desired placeholder: 27 placeholder number: 27 (555) 555-5555 NOTE: the default is '1'
      Returns:
      this
    • placeholderExtension

      default F placeholderExtension(String placeholder)
      Configures the the field to have the placeholder with the desired extension ex. desired placeholder: 123 placeholder number: 1 (555) 555-5555 ext 123 NOTE: the default is blank i.e. ''
      Returns:
      this
    • placeholderPhoneNumber

      default F placeholderPhoneNumber(String placeholder)
      Configures the the field to have the placeholder with the desired extension ex. desired placeholder: 800-588-2300 placeholder number: 1 (800) 588-2300 NOTE: the default is: (555) 555-5555
      Returns:
      this