This content has been marked as final. Show 5 replies
I only looked at the part of your code that is visible without horizontal scrolling, but I didn't see anything where you are passing information back to the calling page. In this specific custom tag, you want to pass back variable names. One of them is Attributes.RangeNum. The syntax to do that is:
<cfset rslt=evaluate("caller.#attributes.RangeNum# = attributes.RangeNum")>
Just to let you know, this is the first custom tag I have tried to do, so I don't know all the tricks. I don't understand why I would need to pass back a variable if the cfsavecontent is in the custom tag. The first part of my code where I reference #attributes.RangeNum# in the cfsavecontent is called by an onChange event for the first Datefield. The problem is that when I put this tag on a page multiple times I have duplicate cfsavecontent tags and I don't know how I can change the variable names each time. The first part of the code I posted above is an attempt to do this, but I had no luck. The second part of the code above shows you a working example of what I want to make a the custom tag to do. Is this even possibe? Should I put the cfsavecontent on the same page as the custom tag is called on and manipulate it that way?
Any help would be awesome!!
Thank you for your time.
The reason you have to pass information back to the calling page is that custom tags are bits of reuseable code that are available to any cf template. These templates don't necessarily have to be written by the same person, or have the same variable names.
The same concept is true with User Defined Functions, either inside or outside components. It's what makes the code so re-useable.
Thanks, I understand now. I haven't needed to return a variable yet and now after looking at the documentation it looks simple.
The only other question that I have is changing the <cfsavecontent> tag's variable name every time the custom tag is called. What I was thinking is that I could pass the custom tag a "attributes.RangeNum" variable and this could be used to change the cfsavecontent variable name. The only problem is that I can't get it to work. Let me know if this is even possible.
Thanks for your help
It looks ok as far as sending an attribute in to the custom tag. Of course there is no code I see that sends anything back to the calling page.
At what point do things go awry?