• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF 8 attributeCollection support for CFX tags

New Here ,
Nov 22, 2007 Nov 22, 2007

Copy link to clipboard

Copied

We recently went with an upgrade from Version: 7,0,0,91690 to Version: 8,0,0,176276 on our dev box!

ColdFusion 8 release notes says that if we get this error in the CodeAnalyzer, we can ignore it. However, we are getting this error even while running the application live.

ColdFusion Code dynamically builds the attributes necessary for the CFX called CFX_SayHello, using a structure and finally calls the custam tag using the following code:

<cfx_SayHello attributeCollection="#atts#" />

We get the below error. Can I get some help from anybody who has any idea of what might be causing this or a workaround?

The error reads as follows:

The attributeCollection attribute cannot be used in combination with other attributes in the cfx tag.


The above tag call works if all attributes are sent separately in the below fashion.

<cfx_SayHello att1="abc" att2="bcd" />


However, we need to use dynamic attributes for accomplishing our business requirements. Also, it is a good methodology as the attributes vary in each scenario when the tag is called. All our apps work fine except this. If we are not able to fix this, we are planning to rollback our upgrade back to CF 7.


Any workaround for this? I tried looping over the attribute collection structure and generating a string that contains the tag call with all attributes listed separately; thereby, using evaluate() function to evaluate the string with tag call dynamically. However, this is failing. Is there any other way or is Adobe working on a fix for CF 8? I can provide any other details if needed.

The stack trace contains the follows:

coldfusion.compiler.validation.ArgumentsAttributeException: The attributeCollection attribute cannot be used in combination with other attributes in the cfx tag.
at coldfusion.compiler.TagNode.validateArgsAttr(TagNode.java:423)
at coldfusion.compiler.SemanticAnalyzer.cftag(SemanticAnalyzer.java:476)
at coldfusion.compiler.SemanticAnalyzer.transform(SemanticAnalyzer.java:104)
at coldfusion.compiler.Treewalker.postorder(Treewalker.java:86).. (truncated)

Thanks,
Arun
TOPICS
Advanced techniques

Views

588

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 23, 2007 Nov 23, 2007

Copy link to clipboard

Copied

quote:

I honestly believe that this is not Java related as Java is/was pre-compiled. This is error is being raised even before the CFX or even CFC is actually getting executed. This is kind of like a pre-compile or semantic error.



You're right. The error is raised before any CF code is executed.

I don't know whether this is deliberate or not. Either the CF 8 documentation is wrong (and it is not allowed for CFX tags) . or this might be a bug.

http://livedocs.adobe.com/coldfusion/8/htmldocs/Elements_04.html

As a work around, you could always pass in your own structure of attributes into the tag and extract them manually.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 29, 2007 Nov 29, 2007

Copy link to clipboard

Copied

You seem to be along my side. I agree with you. I shall try the work around you mentioned.

Additionally, the same CFX tag used to work before we went in for CF8. Hence, I think this is a bug. I also report the same as a bug to Adobe. I get no replies from them till now if or not they are working on it.

We are thinking to roll back to version 7 due to this. I will try the work around. If that works, thats good.

Regardless of the workaround, I think Adobe needs to come up with a fix to this as this is a regression problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 29, 2007 Nov 29, 2007

Copy link to clipboard

Copied

LATEST
I don't know if its deliberate or a bug. Assuming attributeCollection is a documented attribute of all custom tags (including CFX) then that would suggest a bug to me.

A workaround shouldn't be too difficult. The request class has few methods and most are already built-in methods of the Hashtable class. Example request.attributeExists() > Hashtable.containsKey().

You might even try creating a local copy of DebugRequest just inside the processRequest method. You could pass your structure of attributes into the constructor and use it locally to get the attributes. I haven't tried it but it might work for you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation