Like this: -------------------------------------------------------------------- <!--- Create a UDF that returns either a hyperlink or an empty string, depending upon your criteria ---> <cffunction name="IsLink" access="public" returntype="string" output="No"> <cfargument name="arg1" type="numeric" required="yes"> <cfargument name="arg2" type="string" required="yes"> <cfargument name="arg3" type="date" required="yes">
<cfset var myLink = ""> <cfif Arguments.arg3 GT Now()> <cfset myLink = "[<a href='cfmpage.cfm'>Click Me</a>]"> </cfif> <cfreturn myLink> </cffunction> <cfmodule template="#Request.adminLayout#/Header.cfm" pageType="Database"> <cf_DisplayList table="SomeTable" rowsPerPage="50" label="Example" displayALinkToThisSearchForm="No"> <cf_PrimaryKey primaryKeyColumn="SomeColumn" primaryKeyType="integer"> <cf_DisplayColumnInList column="AnotherColumn" label="Ex2" type="varchar(80)"> <cf_DisplayColumnInList column="YetAnotherColumn" label="Ex3" type="datetime"> <cf_DisplayListLinks add="AddForm.cfm" view="No" edit="EditForm.cfm" delete="DeleteForm.cfm"> [<a href="AList.cfm?FromDrill=1">Something</a>] <!--- Call the UDF in the Caller scope ---> #Caller.IsLink(arg1, arg2, arg3)# </cf_DisplayListLinks> </cf_DisplayList> <cfmodule template="#Request.adminLayout#/Footer.cfm"> ------------------------------------------------------ Let me know how that works for you. Respectfully, Adam Phillip Churvis Member of Team Macromedia http://www.ProductivityEnhancement.com Download Plum and other cool development tools, and get advanced intensive Master-level training: * C# & ASP.NET for ColdFusion Developers * ColdFusion MX Master Class * Advanced Development with CFMX and SQL Server 2000 ----- Original Message ----- From: "Dirk Marshall" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, February 16, 2005 1:34 PM Subject: [plum] Display link > I am sure there is a simple solution to this I just can't see it at > the moment. I have a link in a list that is a drill down to another > table. I want to hide that link for a record if there is no value in > the linked field otherwise an error comes up if the link is clicked. > The linked lookup field value may not be filled in when the record is > created as it might not be known yet. Anyway within the > cf_displaylistlinks tag I have the following link > > [<a href="#Application.absoluteUrlRoot#/admin/UDOZoneCodes/UDOZoneCodesList.cfm? UDOZoneCode=#URLEncodedFormat(Trim(Attributes.listQuery.ADD_ZoneInfo_UDOZone Code[currentRow]))#&FromDrill=1">UDO > Zone Codes</a>] > > > I thought I would just wrap the link in an if statement doing a check on the > > Attributes.listQuery.ADD_ZoneInfo_UDOZoneCode[currentRow] variable > > However it appears that variable is put together in the displaylist > tag and has to be in the link format to be recognized. How do I get > that variable value to validate if it has a value or not? I guess I > really just need to know what scope the variable is in to be able to > find it. > > Thanks > > Dirk > > ********************************************************************** > You can subscribe to and unsubscribe from lists, and you can change > your subscriptions between normal and digest modes here: > > http://www.productivityenhancement.com/support/DiscussionListsForm.cfm > ********************************************************************** > ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm **********************************************************************
