Look at /farcry/core/packages/formtools/field.cfc. The edit function in this is the default that all formtool edit functions replace. You'll notice that this function accepts a fieldname argument (as well as others). This value should be used as the id and name of your input field.
Blair On Wed, Jun 22, 2011 at 7:01 PM, smika <[email protected]> wrote: > We need to format a specific field before saving a content object > using ftEditMethod. The problem is that form tools input field to its > id and name parsed content type's object id value without dashes. How > do we get the objectID inside of cfc. > > > For example: > > In the viewsource for the rendered page in admin section for Article > type we can see this: > <input type="text" name="fc523153E09CAB11E08556485B39202E7Atitle" > id="fc523153E09CAB11E08556485B39202E7Atitle" value="" class="textInput > " style="" /> > > In Article.cfc we've tried the following: > 1. For title property: > <cfproperty ftSeq="2"name="title" type="nstring" required="true" > hint="" ftLabel="Title" ftType="string" default="" > ftEditMethod="OnPasteAndSelect"/> > > 2. We've added function: > <cffunction name="onPasteAndSelect" access="public" > returntype="string" description="" output="false"> > <cfset parsedID= > <cfset var html = "" /> > <cfsavecontent variable="html"> > <cfoutput> > > > <input type="text" name="fc#.stProperties.objectid#title" > id="fc#stProperties.objectid#title" value="" class="textInput" > style="" onpaste="alert('I iz in ur textbox, pasting some text')" /> > </cfoutput> > </cfsavecontent> > <cfreturn html /> > </cffunction> > > > This does not work, because it requests objectID which we dont know > how to access. The error is that stProperties does not contain > ObjectID. > > How can we achieve that? > Thanks, > Mika > > Any ideas > > -- > You received this message cos you are subscribed to "farcry-dev" Google > group. > To post, email: [email protected] > To unsubscribe, email: [email protected] > For more options: http://groups.google.com/group/farcry-dev > -------------------------------- > Follow us on Twitter: http://twitter.com/farcry -- You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: [email protected] To unsubscribe, email: [email protected] For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry
