Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

<cfswitch> not working when evaluating a variable returned from a custom tag

Posted on 2006-11-12
2
Medium Priority
?
243 Views
Last Modified: 2013-12-24
I have a custom tag that returns caller.status after a call to that I have a cfswitch statement. NO matter what, the default case is run. I even output #status# in the defaultcase and it will show "OPEN" if that is what the customtag returns, why is the <cfcase value="OPEN"> not running when status = OPEN

The custom tag variable creation looks like: <cfset caller.status = CheckStatus[#attributes.status_col#][1]>

If I use <cfoutput>#status#</cfoutput> right above the cfswtich, it outputs the right value ie. OPEN

The code looks like..

<cfmodule template="mycustomtag">

<cfoutput>##</cfoutput> (this will display OPEN on the screen, but the default case is returned and still shows the status variable a OPEN!)

 <cfswitch expression="#status#">
 
 <cfcase value="OPEN">
 <p><strong>You are currently in a #status# status.</strong></p>
  </cfform>
 
 </cfcase>
 
 <cfcase value="PENDING">
 <p><strong>You are currently in a #status# status.</strong></p>
 </cfcase>
 
 <cfcase value="CONFIRMED">
 <p><strong>You are currently in a #status# status.</strong></p>
 </cfcase>
 
 <cfdefaultcase>ERROR: Current Status unavailable <cfoutput>#status#</cfoutput></cfdefaultcase>
 
0
Comment
Question by:LindaBobzien
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 17927579

 Any chance of a space padding the status variable?  

 <cfswitch expression="#trim(status)#">
0
 

Author Comment

by:LindaBobzien
ID: 17927909
That was it. Man, I was fussing over that for an hour. Thanks.
0

Featured Post

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question