Packageorg.igniterealtime.xiff.data.forms
Classpublic class FormField
InheritanceFormField Inheritance XMLStanza Inheritance ExtensionContainer Inheritance Object
Implements INodeProxy

This class is used by the FormExtension class for managing fields as fields have multiple behaviors depending on the type of the form while containing different kinds of data, some optional some not.

See also

org.igniterealtime.xiff.data.forms.FormExtension
http://xmpp.org/extensions/xep-0004.html


Public Properties
 PropertyDefined By
  desc : String
A natural-language description of the field, intended for presentation in a user-agent (e.g., as a "tool-tip", help button, or explanatory text provided near the field).
FormField
  label : String
A human-readable name for the field.
FormField
  options : Array
If options are provided for possible selections of the value they are listed here.
FormField
  required : Boolean
If true, flags the field as required in order for the form to be considered valid.
FormField
  type : String
The type of this field used by user interfaces to render an approprite control to represent this field.
FormField
  value : String
The chosen value for this field.
FormField
  values : Array
The values for this multiple field.
FormField
  varName : String
The var of this field used to uniquely identify the field in the context of the form.
FormField
 Inheritedxml : XML
The XML node that should be used for this stanza's internal XML representation, base of the XMLStanza, XML element.
ExtensionContainer
Public Methods
 MethodDefined By
  
FormField(type:String = null, varName:String = null, values:Array = null, options:Array = null, label:String = null, desc:String = null, required:Boolean = false)
FormField
 Inherited
Add extension to the list of the given namespace and insert to the XML element as a child.
ExtensionContainer
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(nameSpace:String):Array
ExtensionContainer
 Inherited
getAttribute(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML.
XMLStanza
 Inherited
getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML.
XMLStanza
 Inherited
getExtension(elementName:String):IExtension
Get the extension having the given element name.
ExtensionContainer
 Inherited
getField(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
removeAllExtensions(nameSpace:String):void
ExtensionContainer
 Inherited
removeExtension(extension:IExtension):Boolean
ExtensionContainer
 Inherited
removeFields(name:String):void
Helper method for removing all child elements that have the given name.
XMLStanza
 Inherited
setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML.
XMLStanza
 Inherited
setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML.
XMLStanza
 Inherited
setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
toString():String
Converts the base stanza XML to a string.
XMLStanza
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NS : Namespace
[static] Default XML namespace.
XMLStanza
  ELEMENT_NAME : String = field
[static]
FormField
 InheritedFLASH_NS : Namespace
[static]
XMLStanza
 InheritedSTREAM_NS : Namespace
[static]
XMLStanza
Property Detail
descproperty
desc:String

A natural-language description of the field, intended for presentation in a user-agent (e.g., as a "tool-tip", help button, or explanatory text provided near the field).


Implementation
    public function get desc():String
    public function set desc(value:String):void
labelproperty 
label:String

A human-readable name for the field.


Implementation
    public function get label():String
    public function set label(value:String):void
optionsproperty 
options:Array

If options are provided for possible selections of the value they are listed here.

Applies to the following field types:

FormFieldType.LIST_MULTI FormFieldType.LIST_SINGLE

Array of objects with the properties label and value, {label, value}.

The option element MUST contain one and only one value child. If the field is not of type "list-single" or "list-multi", it MUST NOT contain an option element.


Implementation
    public function get options():Array
    public function set options(value:Array):void
requiredproperty 
required:Boolean

If true, flags the field as required in order for the form to be considered valid.


Implementation
    public function get required():Boolean
    public function set required(value:Boolean):void
typeproperty 
type:String

The type of this field used by user interfaces to render an approprite control to represent this field. May be one of the following: FormFieldType.BOOLEAN FormFieldType.FIXED FormFieldType.HIDDEN FormFieldType.JID_MULTI FormFieldType.JID_SINGLE FormFieldType.LIST_MULTI FormFieldType.LIST_SINGLE FormFieldType.TEXT_MULTI FormFieldType.TEXT_PRIVATE FormFieldType.TEXT_SINGLE


Implementation
    public function get type():String
    public function set type(value:String):void

See also

valueproperty 
value:String

The chosen value for this field. In forms with a type FormType.FORM this is typically the default value of the field. Applies to the following field types: FormFieldType.BOOLEAN FormFieldType.FIXED FormFieldType.HIDDEN FormFieldType.JID_SINGLE FormFieldType.LIST_SINGLE FormFieldType.LIST_MULTI FormFieldType.TEXT_PRIVATE FormFieldType.TEXT_SINGLE

Suggested values can typically be retrieved in getAllOptions


Implementation
    public function get value():String
    public function set value(value:String):void
valuesproperty 
values:Array

The values for this multiple field. In forms with a type FormType.FORM these are typically the existing values of the field. Applies to the following field types: FormFieldType.JID_MULTI FormFieldType.LIST_MULTI FormFieldType.TEXT_MULTI Array containing strings representing the values of this field


Implementation
    public function get values():Array
    public function set values(value:Array):void
varNameproperty 
varName:String

The var of this field used to uniquely identify the field in the context of the form. Note: this serializes to the var attribute on the field node. Since var is a reserved word in ActionScript this field uses varName to describe the var of this field.


Implementation
    public function get varName():String
    public function set varName(value:String):void
Constructor Detail
FormField()Constructor
public function FormField(type:String = null, varName:String = null, values:Array = null, options:Array = null, label:String = null, desc:String = null, required:Boolean = false)

Parameters
type:String (default = null)
 
varName:String (default = null)
 
values:Array (default = null)
 
options:Array (default = null)
 
label:String (default = null)
 
desc:String (default = null)
 
required:Boolean (default = false)
Constant Detail
ELEMENT_NAMEConstant
public static const ELEMENT_NAME:String = field