Chuck...
Are you using MG3? If so, you should look at the new copyToScope() and
event.linkto() functionality. It's designed to replace the "myself" code
that you included below.
For example instead of having to do all those viewState.GetValue calls,
you could put this code at the top of your page:
<cfset event.copyToScope("variables",
"xe.reset,xe.delete,xe.ignore,xe.unignore") />
That single line will copy all those values from the event object into
the variables scope of your view page. Then you can use the
event.linkTo() method to build your URLs like so:
<cfset resetPage = event.linkTo( xe.reset ) />
<cfset deletePage = event.linkTo( xe.delete ) />
You can then continue to use the resetPage, deletePage and other
variables like you have been before.
Hope that helps,
Dan
On 11/30/2009 12:12 PM, Chuck Savage wrote:
> Anyone have a good helper that combines 'myself' and other?
>
> I find that I'm writing ...
>
> <cfset loginPage = viewstate.getValue("myself")& viewstate.getValue
> ("xe.Login") />
> <cfset logoutPage = viewstate.getValue("myself")& viewstate.getValue
> ("xe.Logout") />
> on one page, then another
>
> <cfset myself = viewState.GetValue('myself')>
> <cfset self = myself& viewState.GetValue('event')>
> <cfset resetPage = myself& viewState.GetValue('xe.reset')>
> <cfset deletePage = myself& viewState.GetValue('xe.delete')>
> <cfset ignorePage = myself& viewState.GetValue('xe.ignore')>
> <cfset unignorePage = myself& viewState.GetValue('xe.unignore')>
>
> etc etc. Its getting old fast. I need something smoother and less
> verbose.
>
> Related, can helper cfc's get injected with the event scope/bean?
>
> I'm thinking a custom tag that does something like<cf_myself
> variable="loginPage" e="xe.Login">
> 'variable' being optional, otherwise variable would be the value
> passed into e, so internally to the tag would basically be:
>
> <cfparam name="Attributes.e" type="string" />
> <cfparam name="Attributes.variable" type="string"
> default="#Attributes.e#" />
> <cfset "#Attributes.variable#" = viewState.getValue("myself")&
> viewState.getValue(Attributes.e)>
>
>
--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en