<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: cfqueryparam and conditional handling of NULL&#8217;s</title>
	<atom:link href="http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/</link>
	<description>Rich Internet Application development</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:10:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-141458</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Tue, 27 Sep 2011 21:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-141458</guid>
		<description>@Belden - yep, this is one of the tricky things if you&#039;re testing for specific &quot;types&quot; in your arguments. There are many many ways to handle this. 

Things like just use a string &quot;type&quot; in your function cfargument so the default doesn&#039;t fail. This certainly doesn&#039;t feel like the best, but you can provide validation if needed inside the function.

People also use &quot;-1&quot; as a default, then you could test for len(trim()) as well as &quot;-1&quot; etc.

In this scenario I&#039;d rather have done all my argument checking (from the client) before calling a persistence method (i.e. something saving to the database). Likely a layer up in a Service/Manager etc</description>
		<content:encoded><![CDATA[<p>@Belden &#8211; yep, this is one of the tricky things if you&#8217;re testing for specific &#8220;types&#8221; in your arguments. There are many many ways to handle this. </p>
<p>Things like just use a string &#8220;type&#8221; in your function cfargument so the default doesn&#8217;t fail. This certainly doesn&#8217;t feel like the best, but you can provide validation if needed inside the function.</p>
<p>People also use &#8220;-1&#8243; as a default, then you could test for len(trim()) as well as &#8220;-1&#8243; etc.</p>
<p>In this scenario I&#8217;d rather have done all my argument checking (from the client) before calling a persistence method (i.e. something saving to the database). Likely a layer up in a Service/Manager etc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Belden</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-141416</link>
		<dc:creator>Belden</dc:creator>
		<pubDate>Mon, 26 Sep 2011 18:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-141416</guid>
		<description>Is there a way to still use the &quot;default&quot; attribute for the &quot;cfargument&quot; tag if the form variable you were using were passed in as an argument into a function for the query? I think you might get an error if you tried to make a default of any empty string if the argument you were passing in were an integer, as in the example.</description>
		<content:encoded><![CDATA[<p>Is there a way to still use the &#8220;default&#8221; attribute for the &#8220;cfargument&#8221; tag if the form variable you were using were passed in as an argument into a function for the query? I think you might get an error if you tried to make a default of any empty string if the argument you were passing in were an integer, as in the example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikos</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-111081</link>
		<dc:creator>Nikos</dc:creator>
		<pubDate>Thu, 10 Dec 2009 11:01:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-111081</guid>
		<description>so this is the best way for all datatypes?

null=”#NOT structKeyExists(arguments, ‘age’)#</description>
		<content:encoded><![CDATA[<p>so this is the best way for all datatypes?</p>
<p>null=”#NOT structKeyExists(arguments, ‘age’)#</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-107327</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Mon, 12 Oct 2009 06:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-107327</guid>
		<description>I ran into same situation and found this post. Thanks a million this was exactly what I was looking for.

cheer!</description>
		<content:encoded><![CDATA[<p>I ran into same situation and found this post. Thanks a million this was exactly what I was looking for.</p>
<p>cheer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jDowdle.com &#187; Blog Archive &#187; cfqueryparam, NULLs and Lists</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-71833</link>
		<dc:creator>jDowdle.com &#187; Blog Archive &#187; cfqueryparam, NULLs and Lists</dc:creator>
		<pubDate>Wed, 17 Sep 2008 16:39:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-71833</guid>
		<description>[...] Links: cfqueryparam and conditional handling of NULL’s [...]</description>
		<content:encoded><![CDATA[<p>[...] Links: cfqueryparam and conditional handling of NULL’s [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-55686</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Sat, 21 Jun 2008 01:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-55686</guid>
		<description>@Eric - This would indeed work for varchars, not sure what went wrong for you. Do you have a code sample?

For radio buttons you could replace len(trim()) with isDefined(&quot;myRadioButton&quot;)

Hope that helps.</description>
		<content:encoded><![CDATA[<p>@Eric &#8211; This would indeed work for varchars, not sure what went wrong for you. Do you have a code sample?</p>
<p>For radio buttons you could replace len(trim()) with isDefined(&#8220;myRadioButton&#8221;)</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Smith</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-55635</link>
		<dc:creator>Eric Smith</dc:creator>
		<pubDate>Fri, 20 Jun 2008 19:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-55635</guid>
		<description>You also need to mention that this is not for radio boxes.  Spent a good deal of time finding this out the hard way.

Thanks,
Eric</description>
		<content:encoded><![CDATA[<p>You also need to mention that this is not for radio boxes.  Spent a good deal of time finding this out the hard way.</p>
<p>Thanks,<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Smith</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-55595</link>
		<dc:creator>Eric Smith</dc:creator>
		<pubDate>Fri, 20 Jun 2008 14:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-55595</guid>
		<description>Will this work for a varchar field also?  I tried using your example and just replaced your field name and the data type and it&#039;s not working.

Thanks,
Eric</description>
		<content:encoded><![CDATA[<p>Will this work for a varchar field also?  I tried using your example and just replaced your field name and the data type and it&#8217;s not working.</p>
<p>Thanks,<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-41454</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Thu, 13 Mar 2008 03:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-41454</guid>
		<description>@Tracy - Yep, the last example in the post details that.

There was a problem with the syntax highlighter I was using so I don&#039;t think it was displaying correctly.

I&#039;ve removed the highlighter for the last example and just left it bold.

Thanks</description>
		<content:encoded><![CDATA[<p>@Tracy &#8211; Yep, the last example in the post details that.</p>
<p>There was a problem with the syntax highlighter I was using so I don&#8217;t think it was displaying correctly.</p>
<p>I&#8217;ve removed the highlighter for the last example and just left it bold.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tracy Logan</title>
		<link>http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/comment-page-1/#comment-41420</link>
		<dc:creator>Tracy Logan</dc:creator>
		<pubDate>Wed, 12 Mar 2008 16:34:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.chapter31.com/2007/02/04/cfqueryparam-and-conditional-handling-of-nulls/#comment-41420</guid>
		<description>Note that (at least with CF8), there&#039;s no need for using YesNoFormat() -- like all other CF tag attributes that expect a boolean value, all the usual CF booleans will suffice (0/1, no/yes, true/false).  So a simple ...null=&quot;#NOT structKeyExists(arguments, &#039;age&#039;)#&quot;... will do the trick.  I would expect this to be true of all CF versions, but only have CF8 ready to hand.</description>
		<content:encoded><![CDATA[<p>Note that (at least with CF8), there&#8217;s no need for using YesNoFormat() &#8212; like all other CF tag attributes that expect a boolean value, all the usual CF booleans will suffice (0/1, no/yes, true/false).  So a simple &#8230;null=&#8221;#NOT structKeyExists(arguments, &#8216;age&#8217;)#&#8221;&#8230; will do the trick.  I would expect this to be true of all CF versions, but only have CF8 ready to hand.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: chapter31.nfshost.com @ 2012-02-09 09:17:57 -->
