I tried setting all the properties so that they are not required, but no luck.
I have pasted the code below, perhaps it is some stupid mistake I made that someone can point out?
Ads.cfc:
<cfcomponent extends="farcry.farcry_core.packages.types.types" displayname="Custom gallery object" hint="A gallery for showing associated photos" bCustomType=1>
<!--------type properties-------->
<cfproperty name="adcode" type="string" hint="Ad Code" required="no" default="">
<cfproperty name="adtitle" type="string" hint="Ad Name" required="no" default="Ad">
<cfproperty name="status" type="string" hint="Satus of Ad (draft/pending/approved)" required="Yes" default="draft">
<!---------End Types ------------>
<cffunction name="edit" access="public">
<cfargument name="objectid" required="yes" type="UUID">
<!--- getData for object edit ---> <cfset stObj = this.getData(arguments.objectid)>
<!--- hack to make arguments available to included file --->
<cfset stArgs = arguments>
<cfinclude template="_ads/edit.cfm">
</cffunction>
<cffunction name="display" access="public" output="true">
<cfargument name="objectid" required="yes" type="UUID">
<!--- getData for object edit ---> <cfset stObj = this.getData(arguments.objectid)>
<!--- hack to make arguments available to included file --->
<cfset stArgs = arguments>
<cfinclude template="_ads/display.cfm">
</cffunction>
</cfcomponent>
edit.cfm:
<cfsetting enablecfoutputonly="yes">
<!--- import tag library ---> <cfimport taglib="/farcry/fourq/tags/" prefix="q4">
<cfoutput>Test</cfoutput>
<cfif isDefined("FORM.submit")><!--- perform the update --->
<span class="FormTitle">Object Updated</span>
<cfscript>
// set up object structure
stProperties = structNew();
stProperties.objectid = stObj.objectid;
stProperties.label = form.adtitle;
stProperties.adtitle = form.adtitle;
stProperties.adcode = form.adcode;
stProperties.datetimelastupdated = Now();
stProperties.lastupdatedby = session.dmSec.authentication.userlogin;
// unlock object
stProperties.locked = 0;
stProperties.lockedBy = "";
// save data
setData(stProperties);
</cfscript>
<!--- return to listing page --->
<cflocation url="#application.url.farcry#/admin/customadmin.cfm?module=ads/list.cfm" addtoken="no">
<cfelse>
<!--- Show the form --->
<cfoutput>
<br>
<span class="FormTitle">Ad Details</span><p></p>
<form action="" method="post" enctype="multipart/form-data" name="adForm">
<table class="FormTable">
<!--- Ad title --->
<tr>
<td><span class="FormLabel">Ad Title:</span></td>
<td><input type="text" name="adtitle" value="#stObj.adtitle#" class="FormTextBox"></td>
</tr>
<!--- Ad description --->
<tr>
<td valign="top"><span class="FormLabel">Ad Code:</span></td>
<td><textarea cols="30" rows="10" name="adcode" class="FormTextArea">#stObj.adcode#</textarea></td>
</tr>
<!--- show submit/cancel buttons --->
<tr>
<td colspan="2" align="center">
<input type="Submit" name="Submit" value="Done!" class="normalbttnstyle" onMouseOver="this.className='overbttnstyle';" onMouseOut="this.className='normalbttnstyle';">
<input type="Button" name="Cancel" value="Cancel" class="normalbttnstyle" onMouseOver="this.className='overbttnstyle';" onMouseOut="this.className='normalbttnstyle';" onClick="location.href='#application.url.farcry#/admin/customadmin.cfm?module=ads/list.cfm';"> </td>
</tr>
</table>
</form>
<script>
//bring focus to title
document.adForm.adtitle.focus();
</script>
</cfoutput>
</cfif>
<cfsetting enablecfoutputonly="no">
Geoff Bowers wrote:
Robert wrote:
The edit page is correct, in that I have cfoutputs where they should, etc. The only thing I changed when going through it was use my properties and names where appropriate. (Title=AdTitle, Description=AdCode).
Sounds like something is breakingon object creation. To make things simpler you might make sure you have no required properties in your custom type.
-- geoff http://www.daemon.com.au/
--- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
