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

cfdump

Participant ,
May 07, 2007 May 07, 2007
I'm looking for a way to output <cfdump var="#Session.app_change_list#" label="Changes" expand="yes" > into a user friendly format for clients to see since you don't use cfdump on live sites. All this does is show what changes a user just made and is displayed right after the user makes the changes.

Thanks,
D
TOPICS
Getting started
572
Translate
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

correct answers 1 Correct answer

Advocate , May 07, 2007 May 07, 2007
No worries...I was only guessing list since the word list was in the variable name.

You can do the same type of thing but use a collection loop to loop over the contents of a structure. For an example, I am going to assume that your structure has a key for the type of change and then a value for the change made (might not be the case but this is just for illustrative purposes):
<h3>App Changes</h3>
<p>
<cfloop collection="#session.app_change_list#" item="key">
#key#: <!--- this outputs the name...
Translate
Advocate ,
May 07, 2007 May 07, 2007
To clarify, what's the variable type of session.app_change_list?

If it is, as the name implies, a list, you can loop over the list and output the values:
<h3>App Changes</h3>
<cfloop list="#session.app_change_list#" index="i" delimiters=",">
#i#<br/>
</cfloop>

If it's not a list or your looking for a different approach, please post some more details.

Cheers,
Craig
Translate
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
Participant ,
May 07, 2007 May 07, 2007
Craig,
sorry I should have posted that it's a Struct type. I did try the loop you posted but recieved the following error:

Complex object types cannot be converted to simple values.
The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values.
The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you might be trying to use a query variable in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in later versions.


The error occurred in C:\CFusionMX7\wwwroot\ryh_dev\cfc\views\alertView.cfc: line 12

10 :
11 : <h3>App Changes</h3>
12 : <cfloop list="#session.app_change_list#" index="i" delimiters=",">
13 : #i#<br/>
14 : </cfloop>


Translate
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
Advocate ,
May 07, 2007 May 07, 2007
No worries...I was only guessing list since the word list was in the variable name.

You can do the same type of thing but use a collection loop to loop over the contents of a structure. For an example, I am going to assume that your structure has a key for the type of change and then a value for the change made (might not be the case but this is just for illustrative purposes):
<h3>App Changes</h3>
<p>
<cfloop collection="#session.app_change_list#" item="key">
#key#: <!--- this outputs the name of the key itself --->
#session.app_change_list[key]#<br/><!--- this outputs the actual value of the key -->
</cfloop>
</p>

If you had only one element in your structure and it was session.app_change_list.fontSize = 12px

The (HTML) output would look like:
<h3>App Changes</h3>
<p>
fontSize: 12px;<br/>
</p>

I hope this helps!

Cheers,
Craig
Translate
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
Participant ,
May 07, 2007 May 07, 2007
LATEST
Worked like a champ!

Thanks,
Daren
Translate
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