Ticket #401 (closed enhancement: fixed)

Opened 16 years ago

Last modified 16 years ago

Enhance event.linkTo() to use variables from another scope

Reported by: cfgrok Owned by:
Priority: normal Milestone: 3.1 Maintenance Final
Version: 3.1.261 Severity: normal
Keywords: Cc:

Description (last modified by cfgrok) (diff)

Proposed Method Signature:

Event.linkTo( eventName:String, listOfKeysToAppend:string [, anchor:string] [, preferredContext:struct] )

Proposed Argument Descriptions:

  1. eventName: The name of the Model Glue event to use, this will be the value of whatever is defined for EventValue in the modelglue.modelGlueConfiguration bean definition.
  2. listOfKeysToAppend: A comma delimited list of keys that will be used as ordered URL parameters
  3. anchor: An anchor to append to the URL string
  4. preferredContext: a struct or something with public properties to use as a context for the items in listOfKeysToAppend. If a list item is not defined in preferredContext, or if preferredContext is not passed as an argument, the EventContext ( event.getValue() ) will be used to find the value. Note: Usage of the preferredContext argument will ensure not to alter the state of EventContext.

Proposed Usage:

<cfset event.setValue("WhiskeyPreference", 1) />
<cfset event.setValue("CigarPreference", 1) />

<cfset context = { AccountNumber=123456789, CigarPreference=0 } />

<cfset myLink = event.linkTo("CashMoney", "AccountNumber,WhiskeyPreference,CigarPreference", "profilePic", context) />

The resulting link would be:

http://whatever.com/index.cfm?event=CashMoney&AccountNumber=123456789&WhiskeyPreference=1&CigarPreference=0#profilePic

Change History

Changed 16 years ago by cfgrok

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

Implemented in revision 287

Note: See TracTickets for help on using tickets.