Changes between Version 7 and Version 8 of ReferenceMaterials/EventApi

Show
Ignore:
Timestamp:
01/24/10 14:39:14 (16 years ago)
Author:
DanWilson (IP: 65.190.16.149)
Comment:

added copytoscope doclet

Legend:

Unmodified
Added
Removed
Modified
  • ReferenceMaterials/EventApi

    v7 v8  
    4848 
    4949Name (required) - The name of the argument to check 
     50 
     51== !CopyToScope(scope:struct, listOfEventKeys:string [,arrayOfDefaults:array]) == 
     52 
     53==== Description: ==== 
     54 
     55Populates the scope with event values matched in the listOfEventKeys, and uses an optional array to set default values according to position. This method can replace many Event.getValue() statements with a single line of code. 
     56 
     57 
     58==== Returns: ==== 
     59 
     60Void 
     61 
     62==== Arguments: ==== 
     63 
     64Scope: (required) - A struct or component instance to be populated. 
     65 
     66ListOfEventKeys: (required) - a comma delimited list of keys to look for in the event. Any key not found will be defaulted with an empty string, or if the arrayOfDefaults was passed, the value of the array position matching the position of the current list item. 
     67 
     68ArrayOfDefaults: (optional) - An array of values used as defaults. The first position in the array is the default for the first position in the listOfEventKeys list. This array does not have to have the same length as the listOfEventKeys and if no array item is found the empty string will be used as the default. 
     69 
     70==== Example: ==== 
     71 
     72{{{ 
     73<!-- Someview.cfm ---> 
     74 
     75<cfset defaultArray = ["DefaultForFoot", "DefaultForHand"] /> 
     76<cfset event.copyToScope(variables, "foot,hand,xe.nested", defaultArray) /> 
     77 
     78<!--- the variables scope now contains foot:DefaultForFoot, hand:DefaultForHand, xe.nested:"" ---> 
     79}}} 
    5080 
    5181== Forward(eventhandler:string [, append:list]) == 
     
    133163}}} 
    134164 
     165 
     166 
    135167== !GetValue(name:string [, default:any]) == 
    136168