Confused

ok, an easy what for you

when you output the first level, you should have a link that looks like this
<cfoutput query="mainQuery">
        <a href="bla.cfm?thisID=#ID#&thisParent=#ParentID#">Name</a><br>
</cfoutput>

when you click on the link that you want, the page reloades and now you have
the link that you clicked on, and its parent.


page reloads
------------
- do a query to get all the children from the ID that was passed
- get your main levels again
- output the main query

<cfoutput query="mainQuery">
        <a href="bla.cfm?thisID=#ID#&thisParent=#ParentID#">Name</a><br>
        <cfif isDefined("thisID")>
                <cfif ParentID = thisID>
                        <cfoutput query="subLevel">
        ----<a href="bla.cfm?thisID=#ID#&thisParent=#ParentID#">Name</a><br>
                        </cfoutput>
                </cfif>
        </cfif>
</cfoutput>


this is a really easy way, but in most cases not ideal if your looking at
going more than 2 levels deep.

Regards

Steve Onnis
Domain Concept Designs
+61 422 337 685
+61 3 9444 7504

http://www.domainconceptdesigns.com <http://www.domainconceptdesigns.com>

("If you think it can't be done, you haven't asked me!") - Steve Onnis





-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 7:58 PM
To: CFAussie Mailing List
Subject: [cfaussie] Setting a variable when clicking on a link.


Ok - so I'm writing this and confusingmyself.

I have a table. lib_cat_meta

that table records a unique ID, a label thats not necessarily unique, an
approval status (1 is approved), a parent value (the unique id of a parent
catagory) and a count of how many objects are in each catagory.

First I populate the top level catagories. Basically everything with null
value for parent is a top level catagory.

Query - Cat_TL (catagories top level)

SELECT lib_cat_meta.ID, lib_cat_meta.Label, lib_cat_meta.ObjCount
FROM  lib_cat_meta
WHERE (lib_cat_meta.Parent IS NULL)
And (lib_cat_meta.approved = '1')
ORDER BY lib_cat_meta.Parent

Then I'm outputting those to a table - IE you can see all the top level
catagories that return. Then I get confused. Then you should be able to
click on them, set a value to carry across to the next load of the page. IE
click on Hardware, hardware's ID is 25, so set a variable as 25 for the next
load.

Query - Cat_Cur_Lvl

SELECT lib_cat_meta.ID, lib_cat_meta.Label, lib_cat_meta.ObjCount,
lib_cat_meta.parent
FROM  lib_cat_meta
WHERE (lib_cat_meta.Parent = '#session.selected_branch#')
And (lib_cat_meta.approved = '1')
ORDER BY lib_cat_meta.Parent

So that whichever top level they've selected loads.

Whats the best way to go about it? I considered populating a form with
hidden values, and making the expand image the submit button, but that seems
inelegant.

I considered a javascript solution? Onclick set the value of a hidden form
var to the appropriate ID and submit the form... But buggered if I know how
to do that :)

Ermm.. Help :)

Cheers
Sean



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to