
820
DEVELOPING
COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Las
t
upda
te
d 8/5/2010
<!--- upload.cfm --->
<!--- <cffile action = "upload" destination = "#Expandpath('./upload')#"
nameconflict="makeunique"> --->
<script language="javascript">
var uploadCompleteHandler = function(obj){
var result = "Upload Details:" + "\n\n";
for(var i=0;i < obj.length; i++){
result = "FILENAME: " + obj[i].FI "\n" + "STATUS: " + obj[i].STATUS
+ "\n" + "MESSAGE: " + obj[i].M "\n\n";
}
}
</script>
<br>
<cffileupload
url="uploadall.cfm"
name="myuploader"
onUploadComplete="uploadCompleteHandler"
maxUploadSize=100
stopOnError=false
/>
Using Ajax form controls and features
ColdFusion HTML forms and controls provide the following Ajax-based features:
•
The
cfgrid
,
cfinput
,
cfselect
,
cftextarea
, and
cftree
controls support binding to get control contents.
•
ColdFusion functions support asynchronous submission of forms without refreshing the entire page. When a form
is in an Ajax container control, it is done automatically. Also, the
ColdFusion.Ajax.SubmitForm
JavaScript
function and Ajax proxy
setForm
function support manual asynchronous submissions.
•
The
cfgrid
and
cftree
tags provide HTML grids and trees that do not require a Java applet or Flash.
•
The
cftextarea
control has a rich text editor option. The text editor is configurable.
•
The
cfinput
tag supports a
datefield
type with an Ajax-based pop-up calendar from which user can select the date.
•
The
cfinput
tag with
text
type supports an
autosuggest
attribute that lets you dynamically supply a drop-down
list of field completions based on the current user input.
•
The
cfinput
,
cfselect
, and
cftextarea
tags support a
tooltip
attribute that specifies a pop-up tool tip to
display when the user moves the mouse over the control. The
cftooltip
tag displays a tool over any region of a
page, not just a form control.
Using Ajax form controls
ColdFusion Ajax-based form controls let you submit Ajax forms in your applications without refreshing the entire page.
Note:
When you use Ajax to submit forms asynchronously from the page, you cannot use
cfinput
or
input
tags to
upload files.
Using Ajax containers for form submission
The ColdFusion Ajax container tags,
cfdiv
,
cflayoutarea
,
cfpod
, and
cfwindow
, automatically submit any forms
that they contain asynchronously. When the form is submitted, the result returned by the action page replaces the
contents of the container, but has no effect on the rest of the page.
The following example shows this behavior in the submitSimple.cfm page:
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...