Javascript Object KDFActionCollection
From KallestadWiki
Overview
KDFActionCollections are the superset object that defines Action Groups, Function Sets, and Behaviors. KDFActionCollections contain the data objects that define the majority of rich client side behavior in KDF.
Data Members
- id - identifier of an action collection
- node_id_seed - nodes that are tied to actions need a unique identifier. Nodes without an id property are assigned one, and this seed is incremented each time a new id must be created.
- transact_id_seed - data transactions between the server and the client are uniquely identified. This seed is incremented each time a new transaction is passed to the server.
- pending - a list of pending transactions that are held up for one reason or another, but mainly until asynchronous communication sessions are completed.
- proc - a list of currently processing events. This is used to help prevent inadvertent firing of events - such as when a user double-clicks to provoke an action when only a single click is necessary.
- node_event_sequence - A sequence of Action Groups that are to be fired in response to a given node event.
- page_event_sequence - A sequence of Action Groups that are to be fired in response to a given DOM event.
- neh - a local object bound version of the _node_event_handler function
- nneh - a local object bound version of the _page_event_handler function (non-node-event-handler)
- ajs - a local object bound version of the _ajr_onSuccess function
- actiongroups - an array of Action Groups associated with this particular action collection
Functions
initialize
Creates the Action Collection object.
mykac = new KDFActionCollection(id,opts)
opts
- actiongroups
_attach_events
Called during initialization to attach an event handlers appropriately.
_get_or_set_id
A helper function that returns either the given node's id property, or a newly set id property for the node if one did not exist prior to the function being called.
this._get_or_set_id(node);
_run_ag_sequence
Runs a given array of action groups, iterating through each functionset, and running each behavior associated with the functionset assuming it qualifies as true.
Called by internal event handlers and resume functionality.
this._run_ag_sequence(opts);
opts object
- opts.evt - the event triggering the sequence
- array_of_ids - an array containing the id's of action groups to trigger.
- start_at - a startpoint object for resuming functionality
- startpoint.ag
- startpoint.fs
- startpoint.bh
- tmpvars
- act
_resume_ag_sequence
resumes a paused action group sequence, given a transaction id. Optionally, you can also pass a result set made available as tmpvars.kdf_results, and an error status passed as tmpvars.kdf_status
Called internally by asynchronous event behaviors that require synchronosity.
this._resume_ag_sequence(transact_id,status,rsp);
Note that the event in opts.evt is an emulated event and not a real event. It will not bubble post processing.
