Well in that case
<script>
function goURL(thisItem,thisParent,formName)
{
document[formName].thisItem.value = thisItem;
document[formname].thisParent.value = thisParent;
document[formName].submit()
}
</script>
then do
------------------------
<form name="formName" action="action.cfm" method="post">
<input type="hidden" name="thisID" value="">
<input type="hidden" name="thisParent" value="">
</form>
<cfoutput query="mainQuery">
<a href="javascipt:goURL('#ID#','#ParentID#','formName');">Name</a><br>
<cfif isDefined("thisID")>
<cfif ParentID = thisID>
<cfoutput query="subLevel">
----<a href="javascipt:goURL('#ID#','#ParentID#','formName');">Name</a><br>
</cfoutput>
</cfif>
</cfif>
</cfoutput>
-----------------------
With the endless structure, I would do a recursive routine, and create a
query from the results, then just output the query. The query needs to
contain the depth position in the tree though.
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 9:20 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Setting a variable when clicking on a link.
Hi Steve,
Unfortunately multiple layers are one of the key notions of the application,
and I'm trying to avoid URL scope actions - on the basic principle that it
makes life that much harder for users to break things through being
clueless.
I've been thinking about populating a structure with the relevant details,
and making it persistant in the session scope... But I'm still not sure how
to go about populating the structure based on a link click.
I'm still leaning towards a JS solution... But I keep getting stuck onthe
whole 'but I don't know a damn thing about js, bloody display layer logic
crap'
<a href="javascript:document.testForm.submit();">Submit</a>
<form name="testForm" method="post">
<input type="hidden" name="formInput" value="something">
</form>
The bit I don't know how to do is how to set the value="something" to be
dynamically assigned by JS.
----- Original Message -----
From: "Steve Onnis" <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 7:15 PM
Subject: [cfaussie] RE: Setting a variable when clicking on a link.
> 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/
>
---
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/