CFMBlog
   Home
   Instructions
   Contact
   Login

   MX7 (1)
   CFForm (3)
   Examples (1)

   ASFusion
   CF_PIM

   CFMSource.com

Total blog entries: 1 - 5 out of 5

Blah...

Posted by: Kaigler on June 30, 2005 at 12:00 AM
Category: CFForm
 

I have created a sample peice of code where the cfform type=flash uses the cfsavecontent to call a cfc and return information from a query.

We set up a cfsavecontent named callingCFC and use it when the cfform is submitted. the cfsave content calls the cfc stateResponder.cfc passing it the text entered from the form.  The cfc queries the state table based o the information entered and then returns the information which is then returned to the display field.

stateResponder.cfcbbbb
------------------------------------------

<cfcomponent name="stateResponder" access="public" description="Responds to Flash load vars requests">

<cffunction name="getState"
output="true"
description="Returns the state that was passed"
access="remote" returntype="void">

<cfargument name="passedinfo" required="false" type="string" default=""/>

<cfinclude template = "../getdsninfo.cfm">
<cfquery datasource="#dsname#" name="getstatename" username="#dbusername#" password="#dbpassword#">
 Select * from states
 where state_id = '#passedinfo#'
</cfquery>

<cfoutput>&statename=#getstatename.state#</cfoutput>
</cffunction>

</cfcomponent>

index.cfm
------------------------------

<cfsavecontent variable="callingCFC">
var dataholder  = this.createEmptyMovieClip('dataholder',4587);
dataholder.method = "getState";//the cfc method
dataholder.passedinfo = textEntered.text; //the parameter mask the component expects
dataholder.loadVariables ('stateResponder.cfc', 'POST');//note the component name with full path
var display = display;
var obj = {};
var checkData = function(obj)
{
if(dataholder.statename != undefined)
{
clearInterval(obj.id);
display.text = dataholder.statename;
dataholder.statename = undefined;
}
}
obj.id = setInterval(checkData, 100, obj);
</cfsavecontent>

<cfform name="myform" height="200" width="400" format="Flash" timeout="0" >
<cfformitem name="mesg" type="html"><p>Enter a state abbreviation and click "Get State". </p></cfformitem>
<cfformgroup type="hbox">
<cfformgroup type="vbox" id="displayHolder">
<cfinput type="text" name="textEntered" label="State initials" value="TX">
<cfinput type="text" name="display" disabled="true" style="borderStyle:none; fontWeight:bold; disabledColor:##000000" label="Result" />
</cfformgroup>
<cfformgroup type="vbox" width="120">
<cfinput type="Button" name="setFunction" width="104" value = "Get State" onclick="#callingCFC#" style="cornerRadius:0; borderThickness:1;">
</cfformgroup>
</cfformgroup>
</cfform>



Example:
http://cfform.cfmsource.com/cfquery/index.cfm
Download:
http://cfform.cfmsource.com/cfquery/test.zip

using a cfselect to parse data to cfinputs

Posted by: Kaigler on June 02, 2005 at 12:00 AM
Category: Examples
 

I had a request to take a delimited field within the value of a cfselect and then parse it out to several cfinputs when the value of the select changed.

If anyone is interested in a sample of this please let me know.




time is off by an hour?

Posted by: Kaigler on May 12, 2005 at 12:00 AM
Category: CFForm
 

For some strange reason the time on the questions is off by one hour.  I am adding this question at 10:15 pm but it is displaying as 11:15 pm.  Further, the data in the database has 10:15 pm.

my mask is: mm/dd/yyyy hh:nn:ss

I am so used to coldfusion timformat attributes that I automatically us them first.  Well, in the java and ColdFusion date formatters you use the letter H to represent the hour in 0-23 hour format. However in the flex date formatter (which we use for flash forms) H represents the hour in 1-24 format not the 0-23 format that I was used to. In flash you need to use the letter J for the 0-23 format in a date mask.

Don't forget the location of the coldfusion date/time formats:
http://livedocs.macromedia.com/flex/15/asdocs_en/mx/formatters/DateFormatter.html




free form text in cfform

Posted by: Kaigler on May 07, 2005 at 12:00 AM
Category: CFForm
 

Here is another comment I ad a hard time finding.  How can you add text to a cfform?

 

and here is a sample of a HR:




Initial thoughts on MX7

Posted by: Kaigler on April 24, 2005 at 12:00 AM
Category: MX7
 

I just started looking at the new MX7. Yes, I know I am a little behind. I think the cfform addition of type=flash is going to be huge. It is easy to use and makes things look real slick. The pdf printing seems to be really easy and the jury is still out on the flashpaper.

I am going to start keeping track of the things I come across in MX7 and hopefully focus on the CFForm tag.

Here are my first thoughts of the new version:

  • They were smart enough to create a datefield but they forget about time? In the scheme of things this is not all that difficult to create using cfselect, but why not spend the time when MX7 was being created to add a type=timefield and/or even better a type=datetimefield.
  • Why would macromedia not add a type=file to the cfform type=flash? I understand that the reasoning is some sort of security hole, but why not try to create something and allow you to disallow it from the cfadmin?
  • I see that Philippe Maegerman was experimenting with creating a Rich text area. You can find it at: http://cfpim.coffeeflower.com/richTextAreaIcons/. His site is: http://cfpim.blogspot.com/

Has anyone else come upt with something to integrate as a WYSIWYG editor? In the past i have used SOEditor from http://www.siteojects.com and HTMLArea from http://www.dynarch.com/projects/htmlarea/. I think this is something that is fairly important should the CFFORM era start to become the norm in coldfusion development.