Implements interfaces:
Located in /Form/ZFormElement.php (line 47)
Class | Description |
---|---|
![]() |
Associative array containing the attributes associated with the element
Contains the list of client side behaviors registered on
this element
Contains the list of children associated with the element
Boolean property specifing weather to allow events to fire or not.
Contains the list of client event hooks registered on
this element
Contains the list of the server side events to be fired
this element
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.
Contains a reference to the parent of the element
Boolean property used to signify if processing of the element should continue
Contains the list of client/server side validators registered on
this element
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.
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.
Adds an event listener of the element for the given $type
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.
Adds the $child to the list of children associated with the element The parent of the $child is set to the element
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())
Returns the value of the $name attribute associated with the element
Return the associative array of attribute maintained by the element.
Returns the list (array) of behaviors associated with the element
Return the list (array) of children contained by the element
Returns the childs whose ID is $id. If the $recursive = true, continue search depth first for the child
Simple getter for the event listeners associated with the web element
Return simple ID of the element
Compute, if necessary, and return the fully qualified path of the element within the containment structured defined via the parentnode
Returns the status of the processing flag
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
Return the parent node reference maintained by the element
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'
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
Returns the list of validators associated with the element
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
Default implementation of the ZFormElementEventListenerInterface interface which simply does nothing. Intended to make subclassing more easy.
Does the element contain children?
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
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
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.
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.
Remove the given $child from the list (array) of children associated with the element
Removes behavior from the list of behaviors associated with the element
Removes validator from the list of validators associated with the element
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
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.
Turns of processing events, that is events delivered to the fireEvent method (@see fireEvent()) are not process, they are ignored
Set the value of the $name attribute within the element
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
The bookend implementation to @see getMemento(). This function is a void
implementation of the protocol to simplify the task of subclassing
Changes the parent node associated with the element to the new $parent specified in the parameter.
Sets the processing flag, at any point during the process loop an element can terminate futher process by setting this flag to false
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.
Validates the element and all its children by applying the validators associated with the element and then recursively invoking validate on the children.
Helper array management routines to add/remove and item if it doesn't already exist to an array
Generates the unique ID path for the element which consists of its ancestor IDs concatenated with the element's ID.
Support methods for gathering and redistributing mementos to th children of the element (@see persist(), @see restoreState())
Determines if a given $id is unique within the element children names.
Iterates over the validators associated with the elements and inokes the validator on the element. Errors are collected in the $errors array
Process the list (array) of queued events ready for delivery (@see process(), @see fireEvent()).
Helper array management that removes a given element for a list
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