I extended dmNavigation to add several properties.  Everything works
fine.  However, per my post a few days ago I was not able to right
click in the tree and create a new node.  This was fixed by adding
bUseInTree and bFriendly to the component.  Now, when I create a new
navigation type, it errors out.   Here's the error I get:


BSUCCESS        false
DETAIL  [Macromedia][SQLServer JDBC Driver][SQLServer]Syntax error
converting the varchar value 'false' to a column of data type int.
MESSAGE         Error Executing Database Query.
OBJECTID        E4474D03-9027-F64A-797E856569A6F1DA
SQL     INSERT INTO DBO.dmNavigation ( objectID , lockedBy , label ,
datetimecreated , ownedby , locked , title , status ,
datetimelastupdated , lastupdatedby , createdby ) VALUES ( (param 1) ,
(param 2) , (param 3) , (param 4) , (param 5) , (param 6) , (param 7) ,
(param 8) , (param 9) , (param 10) , (param 11) )


I tracked this to DBGateway.cfc which is called from MSSQLGateway.cfc
which seems correct since I am using MSSQL.

I need help figuring out what is going wrong so I can complete this
project for the client.  Someone please help.  I am pasting my extended
dmNavigation.cfc and edit.cfm files below, however it does not appear
the server even gets to them.  I have not made any changes to the core
files and I'm using 3.0.2RC of farcry.

Thanks in advance.



dmNavigation:

<cfcomponent displayname="Navigation"
extends="farcry.farcry_core.packages.types.dmNavigation" bUseInTree="1"
bFriendly="1">
        <cfproperty name="popup" type="boolean" hint="Whether or not the
navigation node is a popup link or normal page" required="no"
default="0">
        <cfproperty name="statusBar" type="boolean" hint="Whether or not the
status bar should be shown" required="no" default="0">
        <cfproperty name="toolbar" type="boolean" hint="Whether or not the
toolbar should be shown" required="no" default="0">
        <cfproperty name="menubar" type="boolean" hint="Whether or not the
menu bar should be shown" required="no" default="0">
        <cfproperty name="scrollbars" type="boolean" hint="Whether or not
scroll bars should be shown" required="no" default="0">
        <cfproperty name="resizable" type="boolean" hint="Whether or not the
window will be resizable" required="no" default="0">
        <cfproperty name="height" type="numeric" hint="Height of the window
that will be opened" required="no" default="500">
        <cfproperty name="width" type="numeric" hint="Width of the window that
will be opened" required="no" default="500">

        <cffunction name="edit" access="public" hint="edit dmNavigation
nodes">
                <cfargument name="objectID" type="uuid" required="true" 
default="">
                <cfscript>
                        // getData for object edit
                        stObj = this.getData(arguments.objectID);
                </cfscript>

                <cfinclude template="_dmNavigation/edit.cfm">
        </cffunction>

</cfcomponent>



edit.cfm

<cfsetting enablecfoutputonly="yes">

<cfparam name="errormessage" default="">
<cfparam name="bFormSubmitted" default="no">
<cfparam name="title" default="">
<cfparam name="externalLink" default="">
<cfparam name="lNavIDAlias" default="">
<cfparam name="fu" default="">
<cfparam name="form.statusBar" default="false">
<cfparam name="form.menuBar" default="false">
<cfparam name="form.toolbar" default="false">
<cfparam name="form.scrollbars" default="false">
<cfparam name="form.resizable" default="false">
<cfparam name="form.theHeight" default="500">
<cfparam name="form.theWidth" default="500">

<cfimport taglib="/farcry/fourq/tags" prefix="q4">
<cfimport taglib="/farcry/farcry_core/tags/navajo/" prefix="nj">
<cfimport taglib="/farcry/farcry_core/tags/display/" prefix="display">

<!--- editing from site tree --->
<cfset cancelCompleteURL =
"#application.url.farcry#/edittabOverview.cfm?objectid=#stObj.ObjectID#">

<cfif bFormSubmitted EQ "yes">
        <cfif isDefined("form.cancel")> <!--- cancel --->
                <cflocation url="#cancelCompleteURL#" addtoken="no">
                <cfabort>
        <cfelse> <!--- submit --->
                <cfset stProperties = structNew()>
                <cfset stProperties.objectid=stObj.objectId>
                <cfset stProperties.title = form.title>
                <cfset stProperties.label = form.title>
                <cfset stProperties.externalLink = form.externalLink>
                <cfset stProperties.lNavIDAlias = form.lNavIDAlias>
                <cfset stProperties.popup = form.popup>
                <cfset stProperties.statusBar = form.statusBar>
                <cfset stProperties.toolbar = form.toolbar>
                <cfset stProperties.menuBar = form.menuBar>
                <cfset stProperties.scrollbars = form.scrollbars>
                <cfset stProperties.resizable = form.resizable>
                <cfset stProperties.height = form.theHeight>
                <cfset stProperties.width = form.theWidth>
                <cfset stProperties.datetimelastupdated = Now()>
                <cfset stProperties.lastupdatedby =
session.dmSec.authentication.userlogin>
                <cfset stProperties.fu = form.fu>
                <!--- unlock object --->
                <cfset stProperties.locked = 0>
                <cfset stProperties.lockedBy = "">

                <cfif NOT isNumeric(form.theHeight) OR NOT 
isNumeric(form.theWidth)>
                        <cfset errormessage = "The height and width must be 
integer
values.">
                </cfif>

                <cfif Trim(errormessage) EQ "">
                        <!--- update the OBJECT --->
                        <cfset oType = createobject("component",
application.types.dmNavigation.typePath)>
                        <cfset oType.setData(stProperties=stProperties)>

                        <cfif NOT (isdefined("url.ref") AND url.ref eq 
"typeadmin")> <!---
if not typeadmin edit (from site tree edit) --->
                                <!--- get parent to update tree       --->
                                <nj:treeGetRelations typename="#stObj.typename#"
objectId="#stObj.ObjectID#" get="parents" r_lObjectIds="ParentID"
bInclusive="1">
                                <!--- update tree --->
                                <nj:updateTree objectId="#parentID#">
                        </cfif>

                        <cfquery datasource="#application.dsn#">
                        UPDATE #application.dbowner#nested_tree_objects
                        SET objectName = <cfqueryparam 
cfsqltype="cf_sql_varchar"
value="#title#">
                        WHERE objectID = '#stObj.ObjectID#'
                        </cfquery>
                        <cfset application.navid = getNavAlias()>
                        <cfoutput><script type="text/javascript">
                        if(parent['sidebar'].frames['sideTree'])
                                parent['sidebar'].frames['sideTree'].location=
parent['sidebar'].frames['sideTree'].location;
                        parent['content'].location.href = "#cancelCompleteURL#"
                        </script></cfoutput>
                        <cfabort>
                </cfif>
        </cfif>
<cfelse>
        <cfset title = stObj.title>
        <cfset externalLink = stObj.externalLink>
        <cfset lNavIDAlias = stObj.lNavIDAlias>
        <cfset fu = stObj.fu>
        <cfset popup = stObj.popup>
        <cfif len(trim(popup)) eq 0><cfset popup = "No">></cfif>
        <cfset statusBar = stObj.statusBar>
        <cfif len(trim(statusBar)) eq 0><cfset statusBar = "No">></cfif>
        <cfset toolbar = stObj.toolbar>
        <cfif len(trim(toolbar)) eq 0><cfset toolbar = "No">></cfif>
        <cfset menubar = stObj.menubar>
        <cfif len(trim(menubar)) eq 0><cfset menubar = "No">></cfif>
        <cfset scrollbars = stObj.scrollbars>
        <cfif len(trim(scrollbars)) eq 0><cfset scrollbars = "No">></cfif>
        <cfset resizable = stObj.resizable>
        <cfif len(trim(resizable)) eq 0><cfset resizable = "No">></cfif>
        <cfset height = stObj.height>
        <cfset width = stObj.width>
</cfif>

<cfset aNavalias =
listToArray(listSort(structKeyList(application.navid),'textnocase'))>

<cfsetting enablecfoutputonly="no"><cfoutput>

<!--- Show the form --->
<form action="#cgi.script_name#?#cgi.query_string#" class="f-wrap-1
wider f-bg-medium" name="editform" method="post">
<fieldset>
        <div class="req"><b>*</b>Required</div>
<h3>#application.adminBundle[session.dmProfile.locale].navigationNodeDetails#:
<span class="highlight">#stObj.title#</span></h3>
<cfif errormessage NEQ "">
<p id="fading1" class="fade"><span
class="error">#errormessage#</span></p><br />
</cfif>
        <label
for="title"><b>#application.adminBundle[session.dmProfile.locale].titleLabel#<span
class="req">*</span></b>
                <input type="text" name="title" id="title" value="#title#"
maxlength="255" size="45" /><br />
        </label>
        <display:OpenLayer
title="#application.adminBundle[session.dmProfile.locale].advancedOptions#"
isClosed="Yes" border="no">
        <label
for="externalLink"><b>#application.adminBundle[session.dmProfile.locale].symbolicLinkLabel#</b>
                <select name="externalLink">
                        <option value=""<cfif externalLink EQ
"">selected="selected"</cfif>>#application.adminBundle[session.dmProfile.locale].noneForSelect#</option><cfloop
from="1" to="#arraylen(aNavalias)#" index="i">
                        <option value="#application.navid[aNavalias[i]]#"<cfif 
externalLink
EQ
application.navid[aNavalias[i]]>selected="selected"</cfif>>#aNavalias[i]#</option></cfloop>
                </select>
        </label><br />

        <label
for="lNavIDAlias"><b>#application.adminBundle[session.dmProfile.locale].navAliases#</b>
                <input type="text" name="lNavIDAlias" id="lNavIDAlias"
value="#lNavIDAlias#" maxlength="255" size="45" /><br />
        </label><br />

        <label for="fu"><b>Friendly URL:</b>
                <input type="text" name="fu" id="fu" value="#fu#" 
maxlength="255"
size="45" /><br />
        </label><br />

        <label for="popup"><b>Open New Window?</b>
                <select name="popup" onchange="showWindowOptions()">
                                <option value="Yes" <cfif 
popup>selected</cfif>>Yes</option>
                                <option value="No" <cfif NOT 
popup>selected</cfif>>No</option>
                        </select><br>
        </label><br />

        <div id="windowOptionsLabel" style="<cfif
popup>display:block;<cfelse>display:none;</cfif>font-weight:bold;">New
Window Options:<br><br></div>
        <div id="windowOptions" style="<cfif
popup>display:block;<cfelse>display:none;</cfif>font-weight:bold;
margin-left:50px;">
                <label for="statusBar"><b>Show Status Bar?</b>
                        <select name="statusBar">
                                <option value="Yes" <cfif 
statusBar>selected</cfif>>Yes</option>
                                <option value="No" <cfif NOT 
statusBar>selected</cfif>>No</option>
                        </select><br>
                </label>
                <label for="toolbar"><b>Show Toolbar?</b>
                        <select name="toolbar">
                                <option value="Yes" <cfif 
toolbar>selected</cfif>>Yes</option>
                                <option value="No" <cfif NOT 
toolbar>selected</cfif>>No</option>
                        </select><br>
                </label>
                <label for="menuBar"><b>Show Menu Bar?</b>
                        <select name="menuBar">
                                <option value="Yes" <cfif 
menuBar>selected</cfif>>Yes</option>
                                <option value="No" <cfif NOT 
menuBar>selected</cfif>>No</option>
                        </select><br>
                </label>
                <label for="scrollbars"><b>Show Scrollbars?</b>
                        <select name="scrollbars">
                                <option value="Yes" <cfif 
scrollbars>selected</cfif>>Yes</option>
                                <option value="No" <cfif NOT 
scrollbars>selected</cfif>>No</option>
                        </select><br>
                </label>
                <label for="resizable"><b>Resizable?</b>
                        <select name="resizable">
                                <option value="Yes" <cfif 
resizable>selected</cfif>>Yes</option>
                                <option value="No" <cfif NOT 
resizable>selected</cfif>>No</option>
                        </select><br>
                </label>
                <label for="height"><b>Height:</b>
                        <input type="text" name="theHeight" id="theHeight" 
value="#height#"
style="width:50px;"><br>
                </label>
                <label for="Width"><b>Width:</b>
                        <input type="text" name="theWidth" id="theWidth" 
value="#width#"
style="width:50px;"><br>
                </label>
        </div>
        </display:OpenLayer>
</fieldset>
        <div class="f-submit-wrap">
        <input type="submit" name="submit" value="OK" class="f-submit" />
        <input type="submit" name="cancel" value="Cancel" class="f-submit" />
        </div>
        <input type="hidden" name="bFormSubmitted" value="yes">
</form>

<script type="text/javascript">
        //bring focus to title
        document.editform.title.focus();
        qFormAPI.errorColor="##cc6633";
        objForm = new qForm("editform");
        
objForm.title.validateNotNull("#application.adminBundle[session.dmProfile.locale].pleaseEnterTitle#");


        function showWindowOptions() {
                if
(document.editform.popup.options[document.editform.popup.selectedIndex].value
== "Yes"){
                        
document.getElementById("windowOptionsLabel").style.display =
"block";
                        document.getElementById("windowOptions").style.display = 
"block";
                        popupValue = "on";
                }
                else {
                        
document.getElementById("windowOptionsLabel").style.display =
"none";
                        document.getElementById("windowOptions").style.display = 
"none";
                        document.editform.statusBar.options[1].selected = true;
                        document.editform.toolbar.options[1].selected = true;
                        document.editform.menuBar.options[1].selected = true;
                        document.editform.scrollbars.options[1].selected = true;
                        document.editform.resizable.options[1].selected = true;
                        document.getElementById("theHeight").value = "";
                        document.getElementById("theWidth").value = "";
                        popupValue = "off";
                }
        }
</script>
</cfoutput>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to