Record Navigation Bar Custom Tag

Download RecordNavBar.zip (3K)

Description

Requires ColdFusion 5 or greater.

RecordNavBar.cfm is a ColdFusion custom tag that creates a VB-style record navigation control using a standard HTML form. The form uses GET rather than POST.

Syntax

<CF_RecordNavBar
	TARGETURL="URL" 
	KEYNAME="String" 
	KEYLIST="Key list" 
	[LABELLIST="Label list"]
	[CURRENTKEY="Selected key"]
	[DELIMITER="List delimiter"]
	[ALIGN="String"]
	[BGCOLOR="Hex color"]
	[FORMCLASS="Class name"]
	[LABELSIZE="Number"]
	[SELECTSIZE="Number"]
	[TEXTCLASS="Class name"]
	[TEXTONLY="Boolean"]
	[COMPRESS="Boolean"]
>

Attributes

ALIGN     (optional, string)     ALIGN parameter value for nav bar. Left, right, or center. If empty, ALIGN parameter is not used.
BGCOLOR     (optional, string)     Background color in hex for the navigation bar. Default is "EAEAEA".
COMPRESS     (optional, string)     Remove all whitespace from generated code other than single spaces. Default is "YES".
CURRENTKEY     (optional, string)     The currently selected key. This value is selected in the select list (or its ordinal location is used for text box display). Default is to use the first key in the KEYLIST.
DELIMITER     (optional, string)     Delimiter used for lists. All lists must use the same delimiter. Default is a comma (,).
FORMCLASS     (optional, string)     CLASS parameter value for form elements (text box or select list). If empty, no class parameter is created.
KEYLIST     (REQUIRED, list)     Delimited list of key values.
KEYNAME     (REQUIRED, string)     Name of variable to pass when selecting a key. This would normally be the field name used in the WHERE clause to retrieve the selected record.
LABELLIST     (optional, list)     Delimited list of key labels to display in the select list. Number of labels must match the number of keys in the KEYLIST. Default is to use the KEYLIST values.
LABELSIZE     (optional, number)     Maximum length for select list option description. Text is truncated at this point. Default is 200.
SELECTSIZE     (optional, number)     Max number of items to display in the select list. If number of keys in KEYLIST exceeds this number, select list is replaced with text box entry. Set to "0" to always use text box. Default is 50.
TARGETURL     (REQUIRED, string)     Absolute or relative URL of template calling the custom tag. Can include query string.
TEXTCLASS     (optional, string)     CLASS parameter value for text. If empty, no class parameter is created.
TEXTONLY     (optional, string)     Use text links instead of form buttons.

Examples

  1 of 3 

<CFQUERY NAME="MyQuery" DATASOURCE="MyDSN">
	SELECT id, title
	FROM Inventory
</CFQUERY>

<CFPARAM NAME="URL.TestID" DEFAULT="0">
<CFSET DELIM = Chr(7)>

<CF_RecordNavBar 
	TARGETURL="CFCTrecordnavbar.cfm"
	CURRENTKEY="#URL.TestID#"
	KEYNAME="TestID" 
	DELIMITER="#DELIM#"
	KEYLIST="#ValueList(MyQuery.id,DELIM)#" 
	LABELLIST="#ValueList(MyQuery.title,DELIM)#">




Site last updated: 11 March 2012