Packageorg.igniterealtime.xiff.data.forms
Classpublic class FormField
InheritanceFormField Inheritance XMLStanza Inheritance ExtensionContainer
ImplementsISerializable

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
 Inherited_exts : Object
ExtensionContainer
  label : String
The label of this field used by user interfaces to render a descriptive title of this field
FormField
  name : String
The name of this field used by the application or server.
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
 InheritedXMLData : XML
[static]
XMLStanza
 InheritedXMLFactory : XMLDocument
[static]
XMLStanza
Public Methods
 MethodDefined by
  
FormField
 Inherited
ExtensionContainer
 Inherited
addTextNode(parent:XMLNode, elementName:String, value:String):XMLNode
Adds a simple text node to the parent node specified.
XMLStanza
  
deserialize(node:XMLNode):Boolean
Deserializes the FormField data.
FormField
 Inherited
ensureNode(node:XMLNode, elementName:String):XMLNode
Ensures that a node with a specific element name exists in the stanza.
XMLStanza
 Inherited
exists(value:*):Boolean
[static] A helper method to determine if a value is both not null and not undefined.
XMLStanza
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(ns:String):Array
ExtensionContainer
  
getAllOptions():Array
If options are provided for possible selections of the value they are listed here.
FormField
  
getAllValues():Array
The values for this multiple field.
FormField
 Inherited
getExtension(name:String):Extension
ExtensionContainer
 Inherited
getNode():XMLNode
XMLStanza
 Inherited
removeAllExtensions(ns:String):void
ExtensionContainer
 Inherited
ExtensionContainer
 Inherited
replaceTextNode(parent:XMLNode, original:XMLNode, elementName:String, value:String):XMLNode
Replaces one node in the stanza with another simple text node.
XMLStanza
  
serialize(parent:XMLNode):Boolean
Serializes the FormField data to XML for sending.
FormField
  
setAllOptions(value:Array):void
Sets all the options available from an array of objects
FormField
  
setAllValues(value:Array):void
Sets all the values of this field from an array of strings
FormField
 Inherited
setNode(node:XMLNode):Boolean
Sets the XML node that should be used for this stanza's internal XML representation.
XMLStanza
Public Constants
 ConstantDefined by
  ELEMENT_NAME : String = "field"
[static]
FormField
Property detail
labelproperty
label:String  [read-write]

The label of this field used by user interfaces to render a descriptive title of this field

Implementation
    public function get label():String
    public function set label(value:String):void
nameproperty 
name:String  [read-write]

The name of this field used by the application or server. Note: this serializes to the var attribute on the field node. Since var is a reserved word in ActionScript this field uses name to describe the name of this field.

Implementation
    public function get name():String
    public function set name(value:String):void
typeproperty 
type:String  [read-write]

The type of this field used by user interfaces to render an approprite control to represent this field. May be one of the following: FormExtension.FIELD_TYPE_BOOLEAN FormExtension.FIELD_TYPE_FIXED FormExtension.FIELD_TYPE_HIDDEN FormExtension.FIELD_TYPE_JID_MULTI FormExtension.FIELD_TYPE_JID_SINGLE FormExtension.FIELD_TYPE_LIST_MULTI FormExtension.FIELD_TYPE_LIST_SINGLE FormExtension.FIELD_TYPE_TEXT_MULTI FormExtension.FIELD_TYPE_TEXT_PRIVATE FormExtension.FIELD_TYPE_TEXT_SINGLE

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

See also

valueproperty 
value:String  [read-write]

The chosen value for this field. In forms with a type FormExtension.TYPE_REQUEST this is typically the default value of the field. Applies to the following field types: FormExtension.FIELD_TYPE_BOOLEAN FormExtension.FIELD_TYPE_FIXED FormExtension.FIELD_TYPE_HIDDEN FormExtension.FIELD_TYPE_JID_SINGLE FormExtension.FIELD_TYPE_LIST_SINGLE FormExtension.FIELD_TYPE_LIST_MULTI FormExtension.FIELD_TYPE_TEXT_PRIVATE FormExtension.FIELD_TYPE_TEXT_SINGLE Suggested values can typically be retrieved in getAllOptions

Implementation
    public function get value():String
    public function set value(value:String):void
Constructor detail
FormField()constructor
public function FormField()
Method detail
deserialize()method
public function deserialize(node:XMLNode):Boolean

Deserializes the FormField data.

Parameters
node:XMLNode — The XML node associated this data

Returns
Boolean — An indicator as to whether deserialization was successful
getAllOptions()method 
public function getAllOptions():Array

If options are provided for possible selections of the value they are listed here. Applies to the following field types: FormExtension.FIELD_TYPE_JID_MULTI FormExtension.FIELD_TYPE_JID_SINGLE FormExtension.FIELD_TYPE_LIST_MULTI FormExtension.FIELD_TYPE_LIST_SINGLE

Returns
Array — Array of objects with the properties label and value
getAllValues()method 
public function getAllValues():Array

The values for this multiple field. In forms with a type FormExtension.TYPE_REQUEST these are typically the existing values of the field. Applies to the following field types: FormExtension.FIELD_TYPE_JID_MULTI FormExtension.FIELD_TYPE_LIST_MULTI FormExtension.FIELD_TYPE_TEXT_MULTI

Returns
Array — Array containing strings representing the values of this field
serialize()method 
public function serialize(parent:XMLNode):Boolean

Serializes the FormField data to XML for sending.

Parameters
parent:XMLNode — The parent node that this item should be serialized into

Returns
Boolean — An indicator as to whether serialization was successful
setAllOptions()method 
public function setAllOptions(value:Array):void

Sets all the options available from an array of objects

Parameters
value:Array — containing objects with the properties label and value
setAllValues()method 
public function setAllValues(value:Array):void

Sets all the values of this field from an array of strings

Parameters
value:Array — Array of Strings
Constant detail
ELEMENT_NAMEconstant
public static const ELEMENT_NAME:String = "field"