Here is the code for my template.
the problem areas are near the
//===============
and the
//+++++++++++++++
areas
Thanks
Jim
<!--- <input type="file" name="findxml" value="Find XML File"> --->
<!--- Begin creating flash form --->
<cfform name="rules" format="flash" height="400" skin="haloblue">
<!--- Set up initial path for the directory used in the cfselect statement --->
<!--- Use a dummy.xml file to get the proper path --->
<cfset thisPath=ExpandPath("upload\dummy.xml")>
<cfset thisDirectory=GetDirectoryFromPath(thisPath)>
<cfdirectory action = "list"
directory = "#thisDirectory#"
name = "GetXmlFiles"
filter = "*.xml">
<!--- Create a panel in the flash form --->
<cfformgroup type="panel" label="Select xml file from drop down box">
<!--- Create a drop down box using the value of the cfdirectory listing --->
<cfselect name="SelectGetXmlFiles"
query="GetXmlFiles"
value="name"/>
<!--- Set a input box default value = to the value of the selected item in the
cfselect --->
<cfinput name="changeXmlFile" type="text"
bind="{SelectGetXmlFiles.selectedItem.data}" visible="yes"/>
<!--- Create some space and a line in the panel before the tab forms --->
<cfformitem type="spacer" height="25"/>
<cfformitem type="hrule"/>
<!--- Convert file to XML document object --->
<cfset changeXmlFile1 = expandpath("{SelectGetXmlFiles.selectedItem.data}")>
//==========================================================================================================
// THIS PART FAILS TO SET THE VARIABLE
<!--- <cfset myfindxml = "#expandpath('.\#changeXmlFile#')#"> --->
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<!--- The file part does not work, I tried to set this to the value of the set
statement preceeding but that failed as well --->
<cffile action="read"
<!--- I want this part to be dynamic --->
file=
"#ExpandPath('upload\'"#{SelectGetXmlFiles.selectedItem.data}#")#"
variable="myxml">
<cfset mydoc = XmlParse(myxml)>
<!--- Create seperate tabs to organize the information from the xml file --->
<cfformgroup type="tabnavigator" height="250">
<!--- Create Rule Tab --->
<cfformgroup type="page" label="Rule Info">
<cfinput name="libkey" bind="#mydoc.VFPData.xinfo.libkey.XmlText#">
<cfinput name="zipname" bind="#mydoc.VFPData.xinfo.zipname.XmlText#">
<cfinput name="ruleinfo" bind="#mydoc.VFPData.xinfo.ruleinfo.XmlText#">
<cfinput name="tab" bind="#mydoc.VFPData.xinfo.tab.XmlText#">
<cfinput name="subtab" bind="#mydoc.VFPData.xinfo.subtab.XmlText#">
<cfinput name="caption" bind="#mydoc.VFPData.xinfo.caption.XmlText#">
</cfformgroup>
<!--- Create File Tab --->
<cfformgroup type="page" label="File Info">
<cfinput name="createdby" bind="#mydoc.VFPData.xinfo.createdby.XmlText#">
<cfinput name="source" bind="#mydoc.VFPData.xinfo.source.XmlText#">
<cfinput name="reason" bind="#mydoc.VFPData.xinfo.reason.XmlText#">
<cfinput name="comments" bind="#mydoc.VFPData.xinfo.comments.XmlText#">
</cfformgroup>
<!--- Create Contact Info Tab --->
<cfformgroup type="page" label="Contact Info">
<cfinput name="contacinfo" bind="#mydoc.VFPData.xinfo.contacinfo.XmlText#">
</cfformgroup>
</cfformgroup>
</cfformgroup>
<!--- Create Browse for file control --->
<cfinput type="button" value="parse" name="parsexml" onClick="">
</cfform>
>Post some code and a sample file if applicable.
>
>
>
>
>"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
>Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
>Registered in England, Number 678540. It contains information which is
>confidential and may also be privileged. It is for the exclusive use of the
>intended recipient(s). If you are not the intended recipient(s) please note
>that any form of distribution, copying or use of this communication or the
>information in it is strictly prohibited and may be unlawful. If you have
>received this communication in error please return it to the sender or call
>our switchboard on +44 (0) 20 89107910. The opinions expressed within this
>communication are not necessarily those expressed by Reed Exhibitions."
>Visit our website at http://www.reedexpo.com
>
>-----Original Message-----
>From: James Schell
>To: CF-Newbie
>Sent: Sun Jun 10 15:44:57 2007
>Subject: binding the value of a cfselect to a variable
>
>Hello from cfnoob,
>
>
>I am looking to bind the value of a cfselect box to a variable which is in
>turn used as the file attribute in a cffile statement.
>
>Basically I want the user to hit the drop down box and select a file from a
>specified directory and then populate a series of text boxes with values
>from the selected file. The file types are all xml. So this is my way of
>displaying the values defined in the xml.
>
>I just cannot seem to get the value of the myselect.selectedItem.data to
>function in file="expandpath(#myselect.selectedItem.data#)"
>
>Any help would be greatly appreciated.
>
>Thanks
>
>Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7.
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2826
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15