Hey John,
I was playing around with the code and modified it slightly for my
needs (using filters since Chris has persuaded me to use them more
often! haha). Works so well and I thought I'd share it to see if it
can do with more refinement. Thanks for the idea!
<cffunction name="init">
<cfset
filters(through="persistVariables",only="new,edit",type="after") />
</cffunction>
<cffunction name="persistVariables">
<cfset session.persistantvariables = StructCopy(params) />
</cffunction>
<cffunction name="update">
<cfscript>
//dump(session);
if(NOT StructKeyExists(params,"key"))
{
redirectTo(back=true);
}
LayoutListProperties =
model("LayoutListProperties").findByKey(params.key);
if (LayoutListProperties.update(params.LayoutListProperties)){
persistRedirectTo(action="index");
} else {
renderPage(action="edit");
}
</cfscript>
</cffunction>
<cffunction name="persistRedirectTo">
<cfset var args = {} />
<cfif isDefined("session.persistantVariables")>
<cfset args = StructCopy(session.persistantVariables) />
<cfelseif isDefined("arguments") AND IsStruct(arguments)>
<cfset args = StructCopy(arguments) />
<cfelse>
<cfset args.route = "home" />
</cfif>
<cfset StructDelete(session,"persistantVariables") />
<cfset redirectTo(argumentCollection=args) />
</cffunction>
On Aug 6, 4:36 pm, "John C. Bland II" <
johncblan...@gmail.com> wrote:
> Thanks guys!
>
> I'm Wheels'n regularly now so you can expect more writing.
>
> --------------------------
> John C. Bland II
> Mobile
>
> On Aug 5, 2010 9:04 PM, "Chris Peters" <
ch...@clearcrystalmedia.com> wrote:
>
>
>
> > In agreement on coolness. Thanks for taking the time to give us a
> shout-out
> > on your blog, John. I hope you can write more in the future. :)
>
> > On Thu, Aug 5, 2010 at 7:15 PM, raulriera <
rierar...@gmail.com> wrote:
>
> >> This is cool!
>
> >> On Aug 5, 11:37 pm, "John C. Bland II" <
johncblan...@gmail.com> wrote:
> >> >
http://cli.gs/Eng8g
>
> >> > I just blogged this and wanted to pass it along. I believe someone was
> >> > discussing this recently so there could be other ways of doing this.
> I'd
> >> > like to know others if so.
>
> >> > Thanks folks!
>
> >> > ---
> >> > John C. Bland
> >> IIhttp://www.johncblandii.comhttp://www.johnandseason.comhttp://
> >>
www.twitter.com/johncblandii
> >> > ---
> >> > Suggested sites:
http://www.lifthimhigh.com-"Christian Products for
> >> Those Bold Enough to
> >> > Wear Them"
http://www.sportsmatchmaker.com-"What are you doing today?"
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "ColdFusion on Wheels" group.
> >> To post to this group, send email to
cfwh...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >>
cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>
>
> <
cfwheels%2Bunsu...@googlegroups.com<cfwheels%252Bunsubscribe@googlegro
ups.com>
>
cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>