<cfimport taglib="../ctags/" prefix="tag">

<cfset Title = "Concatenations">

<cfset qSubs = Application.Lists.getSubs()>

<!--- Set filters from form --->
<cfset sRecords = StructNew()>
<cfset fields = "RecordVal,FirstName,LastName,FullName,LastNameFirst">
<cfloop index="field" list="#fields#">
	<cfif StructKeyExists(URL,field) AND Len(URL[field])>
		<cfset sRecords[field] = URL[field]>
	</cfif>
</cfloop>

<!--- This is just to show this file in the source view --->
<cfset layout.addSourceFile("/sys/datamgr/Records.cfc")>
<cfset layout.addSourceFile("/sys/datamgr/Concats.cfc")>

<cfoutput>#layout.head(Title)#</cfoutput>
<cfoutput>#layout.body()#</cfoutput>

<h1><cfoutput>#Title#</cfoutput></h1>

<p>You can use the "concat" relationship to automatically include a concatination in the getRecords() results. Unlike other relationships, this relationship will not be used in filter and cannot be saved.</p>

<p>The "concat" value can, however, be used in other relationships. For example, it can be used in a "label" relationship from another table.</p>

<tag:sebForm sendforward="false" method="get">
	<tag:sebField fieldname="FirstName" label="First Name" size="20">
	<tag:sebField fieldname="LastName" label="Last Name" size="20">
	<tag:sebField fieldname="FullName" label="Full Name" size="20">
	<tag:sebField fieldname="LastNameFirst" label="Last Name First" size="20">
	<tag:sebField type="Submit" label="Search">
</tag:sebForm>

<hr />

<tag:sebTable
	label="Record"
	pkfield="RecordID"
	editpage="concat-edit.cfm"
	isAddable="true"
	isDeletable="false"
	isEditable="false"
	CFC_Component="#Application.Concats#"
	CFC_GetMethod="getRecords"
	CFC_GetArgs="#sRecords#"
	CFC_DeleteMethod="removeRecord"
	width="90%"
	>
	<tag:sebColumn dbfield="LastNameFirst" label="Last Name First">
	<tag:sebColumn dbfield="FullName" label="Full Name">
	<tag:sebColumn dbfield="FirstName" label="First Name">
	<tag:sebColumn dbfield="LastName" label="Last Name">
	<tag:sebColumn link="concat-edit.cfm?id=" label="edit">
	<tag:sebColumn type="delete">
</tag:sebTable>

<cfoutput>#layout.end()#</cfoutput>