ZFormElementImplements interfaces:
Located in /Form/ZFormElement.php (line 47)
| Class | Description |
|---|---|
ZFormWebElement
|
array;
$_attributes
= null (line 107)
Associative array containing the attributes associated with the element
array
$_behaviors
= null (line 85)
Contains the list of client side behaviors registered on
this element
array
$_childNodes
= null (line 92)
Contains the list of children associated with the element
boolean
$_eatEvents
= false (line 124)
Boolean property specifing weather to allow events to fire or not.
mixed
$_errors
= null (line 78)
array
$_eventListeners
= null (line 69)
Contains the list of client event hooks registered on
this element
array
$_events
= null (line 62)
Contains the list of the server side events to be fired
this element
string
$_idPath
= null (line 117)
The full path name of the element. Elements must be uniquely identified within the context of their parent. The _idPath is construct by combining the parent references and the ID of the element into a path separated by PATH_SEPARATOR.
ZFormElement
$_parentNode
= null (line 99)
Contains a reference to the parent of the element
toolean
$_process
= false (line 132)
Boolean property used to signify if processing of the element should continue
array
$_validators
= null (line 76)
Contains the list of client/server side validators registered on
this element
Constructor __construct (line 153)
Class constructor. Initializes internal instance variables. $id is
optional however it is recommended the each element by name. If an $id is not passed a unique one will be generated. Additionally, if a $parentNode is passed upon exit from the constructor the new instance is appended to the child list.
addBehavior (line 796)
Add the given behavior to the list of behaviors associated with the element. If the behavior is already contained in the list no action is taken. Elements support multiple behaviors on a FIFO basis. When a behaviors fails the remaining behaviors (if any) are not called.
addEventListener (line 699)
Adds an event listener of the element for the given $type
addValidator (line 753)
Add the given validator to the list of validators associated with the element. If the validator is already contained in the list no action is taken. Elements support multiple validators on a FIFO basis. When a validator fails the remaining validators (if any) are not called.
appendChild (line 321)
Adds the $child to the list of children associated with the element The parent of the $child is set to the element
fireEvent (line 651)
Fire the given event into the element tree. Elements are not
delivered right away, they are queued for delivery at the appropriate time of the process cycle (@see process())
getAttribute (line 246)
Returns the value of the $name attribute associated with the element
getAttributes (line 269)
Return the associative array of attribute maintained by the element.
getBehaviors (line 824)
Returns the list (array) of behaviors associated with the element
getChildNodes (line 217)
Return the list (array) of children contained by the element
getElementById (line 839)
Returns the childs whose ID is $id. If the $recursive = true, continue search depth first for the child
getEventListeners (line 737)
Simple getter for the event listeners associated with the web element
getID (line 189)
Return simple ID of the element
getIDPath (line 174)
Compute, if necessary, and return the fully qualified path of the element within the containment structured defined via the parentnode
getIsProcessing (line 472)
Returns the status of the processing flag
getMemento (line 868)
Default implementation of retriving the memento associated with the element
that will be used during persistent (@see persist()) The default implementation does not persist anything, we implement it here so subclasses are not required to
getParentNode (line 280)
Return the parent node reference maintained by the element
getRoot (line 202)
Searchs the parent chain defined by the _parentNode reference until the top of the tree is reached. If the element has no parents then the element is the 'root'
getValidationErrors (line 502)
Returns the array of validation errors associated with the element.
The array is an assoc array whose key is the ID path of the child element and the value which is an array of validators that reported the error
getValidators (line 782)
Returns the list of validators associated with the element
getValue (line 364)
Abstract method used to retrive the value associated with the
element. Each element maintains an abstract value which can be changed which triggers a value change event. This method is abstract so subclasses can define the contents of that value
handleEvent (line 884)
Default implementation of the ZFormElementEventListenerInterface interface which simply does nothing. Intended to make subclassing more easy.
hasChildNodes (line 308)
Does the element contain children?
invokeApplication (line 574)
Abstract implementation of invoking the application component associated
with the element. This method simply recurs over the children of the element calling the invokeApplication of each child. Subclasses should call this method (e.g. parent::invokeApplication) to invoke application logic that is associated with its children
loadRequestData (line 591)
Abstract implementation that interates of the children of the element invoking loadRequestData. During this phase of the processing cycle elements should retrieve input data from the ZRequest object
persist (line 633)
Persists the elements to the session for subsequent restoration and presentation to the user (this is useful with multi-page forms).
Persisting an element consists of asking itself and each of its children for a memento which is place into the session object. Upon restoreState the memento is passed to the object for reconstitution.
process (line 414)
This method (process) does much of the work associated with the element.
In general, ZFormElement enables the processing of input data(request and persistent) to be loaded/validated and committed to the application model. ZFormElements can be wired-up to each other so that events can be triggered in one element and consumed in another. Processing of an element and its children does not render the element tree, it simply gives the controls a chance to interact with each other and the controller of the application. Rendering is defined by subclasses and/or templating engines. Processing consists of: 1) If the element is persistent restore the saved state @see restoreState() 2) Allow events to be process after restoring the state 3) Ask the elements to load state from the request parameter. 4) Allow events to be process after loading data from request 5) Validate the data loaded 6) Allow events to be process after loading data from request 7) Invoke the application to allow the elements to communicate with the model 8) One last chance to process events NOTE: Events are queued during steps 1, 3, 5, 7 until the whole child tree has been visited.
removeChild (line 341)
Remove the given $child from the list (array) of children associated with the element
removedBehavior (line 813)
Removes behavior from the list of behaviors associated with the element
removedValidator (line 771)
Removes validator from the list of validators associated with the element
removeEventListener (line 676)
Remove the event listener associated with the given event type from the list of listeners. If $listener is not specified all events of the given type will be removed from the listeners
restoreState (line 613)
An element can persist itself between requests (@see persist()), if so it is during this stage of the processing cycle that elements restore their state. Persistent data is retrieved from the session object under the elements idPath.
setAllowEvents (line 721)
Turns of processing events, that is events delivered to the fireEvent method (@see fireEvent()) are not process, they are ignored
setAttribute (line 258)
Set the value of the $name attribute within the element
setID (line 232)
Sets the ID of the element. The ID is checked for validitiy within
the parent naming space. NOTE: IDs must be unique within the parent name space. If the name collides a ZFormElementException is thrown Additionally, the id path is recalcuated when the ID is changed
setMemento (line 876)
The bookend implementation to @see getMemento(). This function is a void
implementation of the protocol to simplify the task of subclassing
setParentNode (line 292)
Changes the parent node associated with the element to the new $parent specified in the parameter.
setProcess (line 460)
Sets the processing flag, at any point during the process loop an element can terminate futher process by setting this flag to false
setValue (line 376)
Implementation of the setValue which ONLY generates a ONVALUECHANGE event if the new $value is different from the current value. This means the subclasses MUST call this implementation and store the value.
validate (line 517)
Validates the element and all its children by applying the validators associated with the element and then recursively invoking validate on the children.
_appendToList (line 898)
Helper array management routines to add/remove and item if it doesn't already exist to an array
_computeIDPath (line 937)
Generates the unique ID path for the element which consists of its ancestor IDs concatenated with the element's ID.
_gatherMementos (line 1016)
Support methods for gathering and redistributing mementos to th children of the element (@see persist(), @see restoreState())
_isLegalName (line 962)
Determines if a given $id is unique within the element children names.
_performValidation (line 533)
Iterates over the validators associated with the elements and inokes the validator on the element. Errors are collected in the $errors array
_processEvents (line 986)
Process the list (array) of queued events ready for delivery (@see process(), @see fireEvent()).
_removeFromList (line 916)
Helper array management that removes a given element for a list
_restoreMementos (line 1039)
Support methods for gathering and redistributing mementos to th children of the element (@see persist(), @see restoreState())
Documentation generated on Wed, 21 Feb 2007 12:03:26 -0800 by phpDocumentor 1.3.1