this is the code i am using while attempting to do a cascade delete of
navagation items in our custom menu system. it will delete the parent nav but
then errors out while attempting to delete the sub navs. and comments r
suggestions would be welcome.
<cfoutput>
<body onload="self.focus();">
<form
action="winNavDelete.cfm?navTextID=#qryHeadNavEdit.navTextID#&navID=#qryHeadNavEdit.navid#&parentNavID=#qryGetNavEdit.navid#&navlevel=2&navBranch=#qryGetNavEdit.navBranch#"
method="post">
<cfif isDefined("url.NavTextId") and request.user.type eq 4 and
IsDefined("form.fieldnames") IS FALSE>
<cfquery datasource="#request.dsn#" name="qryNav1">
dbo.spNavigation 1, #url.navID#, null, 4
</cfquery>
<cfif qryNav1.recordCount>
<cfloop query="qryNav1">
<cfquery datasource="#request.dsn#" name="qryNav2">
dbo.spNavigation 1, #qryNav1.navID#, null, 4
</cfquery>
<cfif qryNav2.recordCount>
<cfloop query="qryNav2">
<cfquery datasource="#request.dsn#" name="qryNav3">
dbo.spNavigation 1, #qryNav2.navID#, null, 4
</cfquery>
<cfif qryNav3.recordCount>
<cfloop query="qryNav3">
<cfquery datasource="#request.dsn#"
name="qryNavDelete">spNavDelete '#url.NavTextId#'</cfquery>
</cfloop>
<cfquery datasource="#request.dsn#"
name="qryNavDelete">spNavDelete '#url.NavTextId#'</cfquery>
</cfif>
</cfloop>
<cfquery datasource="#request.dsn#" name="qryNavDelete">spNavDelete
'#url.NavTextId#'</cfquery>
</cfif>
</cfloop>
</cfif>
<div align="center">
<p>Are you sure you want to remove
<strong>#qryNavInfo.NavText#</strong> from the menu
Navigation list?</p>
<input type="submit" value="remove this menu item"
name="submit">
<br><br>
<input type="button" value="cancel"
onClick="self.close();">
</div>
</form>
<!--- this section is the confirmation of delete success --->
<cfelseif IsDefined("form.fieldnames")>
<!--- set the active fields to false --->
<cfquery datasource="#request.dsn#" name="qryNavDelete">spNavDelete
'#url.NavTextId#'</cfquery> <!--- query for the removal of nav item--->
<div align="center">
Menu Navigation Item Deleted
<hr noshade size="1" color="Silver">
<input type="Button" value="Close Window"
onClick="window.opener.location.reload();self.close();">
</div>
</cfif>
</body>
</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301943
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4