Packageorg.flashapi.swing.form
Interfacepublic interface FormObject extends Finalizable, flash.events.IEventDispatcher
Implementors AFM, Form, LoggingForm, MultiForm, SimpleForm

Language Version : ActionScript 3.0
Product Version : SPAS 3.0
Runtime Versions : AIR 1.0, Flash Player Player - 9

The FormObject interface is the markup interface for all form objects that extend the AFM class.

See also

org.flahspai.swing.form.AFM


Public Properties
 PropertyDefined By
  forceSubmitFunction : Boolean
A false value that specifies the behavior of the onSubmit action.
FormObject
  onResponse : Function
Invoked whenever a response has been sent by the server.
FormObject
  onSubmit : Function
Invoked whenever form data is sent to the specified URI through the WebService defined for this FormObject instance.
FormObject
  outputRequest : Boolean
A Boolean value that indicates wheter the request sent to the specified URI should be output for debugging (true), or not (false).
FormObject
  url : String
Sets or gets the URI where is located the Web sevice to use with this FormObject instance.
FormObject
  variables : Dictionary
[read-only] Returns a collection of objects defined by pairs of a variable name and their corresponding data values.
FormObject
  webService : WebService
[read-only] Returns a reference to the WebService object used by this FormObject instance.
FormObject
Public Methods
 MethodDefined By
  
check():Boolean
Checks whether all fields in a form are valid, or not.
FormObject
 Inherited
finalize():void
Use the finalize() method to ensure that all internal process of an object are killed before you delete it.
Finalizable
  
reset():void
Resets this FormObject instance.
FormObject
  
submit():void
Gets data from all form item objects within this FormObject instance and sends the request to the specified URI.
FormObject
  
test():Boolean
Checks whether all fields in a form are valid, or not.
FormObject
Property Detail
forceSubmitFunctionproperty
forceSubmitFunction:Boolean

A false value that specifies the behavior of the onSubmit action. If true, the onSubmit action is fired before data treatment and submition, even if the url parameter is null.

If false, the onSubmit action is fired only if the data treatment has succeeded, which means that all validation routines have succeeded, and the url parameter is not null.

The default value is false.


Implementation
    public function get forceSubmitFunction():Boolean
    public function set forceSubmitFunction(value:Boolean):void
onResponseproperty 
onResponse:Function

Invoked whenever a response has been sent by the server. This function must have an object parameter which is the result parameter of the WebServiceEvent event, as shown below:

		 		var form:Form = new Form();
		 		form.onResponse = function(result:Object):void {
		 			trace (result);
		 		}
		 	

If null, the onResponse event function is not invoked.

The default value is null.


Implementation
    public function get onResponse():Function
    public function set onResponse(value:Function):void

See also

onSubmitproperty 
onSubmit:Function

Invoked whenever form data is sent to the specified URI through the WebService defined for this FormObject instance. This function must have an object parameter which is a reference to the FormObject instance, as shown below:

		 		var form:Form = new Form();
		 		form.onSubmit = function(obj:Form):void {
		 			trace(obj);
		 		}
		 	

If null, the onSubmit event function is not invoked.

The default value is null.


Implementation
    public function get onSubmit():Function
    public function set onSubmit(value:Function):void

See also

outputRequestproperty 
outputRequest:Boolean

A Boolean value that indicates wheter the request sent to the specified URI should be output for debugging (true), or not (false).

The default value is false.


Implementation
    public function get outputRequest():Boolean
    public function set outputRequest(value:Boolean):void
urlproperty 
url:String

Sets or gets the URI where is located the Web sevice to use with this FormObject instance. The url property is the same as url property of the WebService object specified by the webService property.

The default value is null.


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

See also

variablesproperty 
variables:Dictionary  [read-only]

Returns a collection of objects defined by pairs of a variable name and their corresponding data values. Each pair represents data values for a form item object contained within this FormObject instance.


Implementation
    public function get variables():Dictionary
webServiceproperty 
webService:WebService  [read-only]

Returns a reference to the WebService object used by this FormObject instance.


Implementation
    public function get webService():WebService
Method Detail
check()method
public function check():Boolean

Checks whether all fields in a form are valid, or not. Once the validation has been performed, if some fields are not valid, related error messages are displayed.

Returns
Boolean — If the form is valid, true; otherwise, false.

See also

reset()method 
public function reset():void

Resets this FormObject instance.

submit()method 
public function submit():void

Gets data from all form item objects within this FormObject instance and sends the request to the specified URI.

See also

test()method 
public function test():Boolean

Checks whether all fields in a form are valid, or not. Once the validation has been performed, no error messages are displayed, even if some fields are not valid,.

Returns
Boolean — If the form is valid, true; otherwise, false.

See also