I'm not familiar with all of the query functions yet. Guess I better start fiddling with those. I'm assuming that I can just add rows at will to a query in a variable?
Thanks, Dan > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Phil Cruz > Sent: Sunday, February 27, 2005 11:00 PM > To: [email protected] > Subject: Re: [CFCDev] Using Structures to handle navigation > (order problems) > > Use queryNew() to create query object. You can add a column for > "position" so you can do a query of query to sort it (if it doesn't > maintain the inserted order). > > -Phil > > > On Sun, 27 Feb 2005 22:43:55 -0800, Daniel Short > <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > > I'm trying to use a structure to hold the navigation scheme > for a site. > > Unfortunately, the fact that "structure keys are unordered" > as the livedocs > > tell me, is causing a problem. Here's what I'm doing. > > > > I use the addItem method of my CFC to add new items to my > navigation. > > > > <cfset addItem("Overview", "title.cfm")> > > <cfset addItem("Table of Contents", "toc.cfm")> > > <cfset addItem("Tasks", "tasks.cfm")> > > <cfset addItem("Details", "details.cfm")> > > <cfset addItem("Project Team", "team.cfm")> > > > > addItem looks like so: > > > > <cffunction name="addItem" displayName="Add Item" hint="I > add a navigation > > item to a navigation block." access="public" returnType="boolean" > > output="false"> > > <cfargument name="LinkName" type="string" required="true"> > > <cfargument name="PageName" hint="The .cfm page to link to" > > type="string" required="true"> > > <cfset var local = StructNew()> > > <cfset local.item = StructNew()> > > <cfset StructInsert(local.item, arguments.LinkName, > > arguments.PageName)> > > > > <cfset setNavigation(local.item)> > > > > <cfreturn true> > > </cffunction> > > > > setNavigation looks like this: > > > > <cffunction name="setNavigation" access="private" returntype="VOID" > > output="false"> > > <cfargument name="NavItem" type="struct" > required="true" hint="A > > structure containing the navigation item to add to the list"> > > <cfset StructAppend(variables.instance.navigation, > > arguments.NavItem)> > > </cffunction> > > > > Variables.instance.navigation holds my navigation structure. Now, > > considering the order in which I added my navigation items, > I would expect > > them to be spit out in the same order. Instead they come > out like so: > > > > Details, Table of Contents, Overview, Project Team, Tasks > > > > Now, if structs really were unordered, I would expect that > they would > > occassionally come out in a *different* order, but nope... > They always come > > out in the same order, WRONG! :). > > > > Anyone have any ideas to help me crack this nut? > > > > Thanks, > > > > Dan > > > > ---------------------------------------------------------- > > You are subscribed to cfcdev. To unsubscribe, send an email > to [email protected] with the words 'unsubscribe cfcdev' as > the subject of the email. > > > > CFCDev is run by CFCZone (www.cfczone.org) and supported by > CFXHosting (www.cfxhosting.com). > > > > An archive of the CFCDev list is available at > > www.mail-archive.com/[email protected] > > > > > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [email protected] with the words 'unsubscribe cfcdev' as > the subject of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported by > CFXHosting (www.cfxhosting.com). > > An archive of the CFCDev list is available at > www.mail-archive.com/[email protected] > > > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
