I'm absolutely baffled!
I've been quite happily passing the dataProvider for a grid in a flash
form into a cfc and then working with the array of struct that ends up
in my cfc method.
Now all of a sudden the visible fields in the grid are suddenly coming
up as "[undefined struct element]" when I dump the array into a file. I
can do an alert of the content of one or more of the visible columns
before and after the call to the cfc, but the cfc only ever gets values
in the hidden columns.
I've gone around and around and still no joy. I have no idea why this
should suddenly start happening. If this hadn't happened I would have
had this all done yesterday instead I've spent 8 hours messing with this
to no avail!
I really would appreciate any and all help as I need to have this
complete this time tomorrow. Below are some code snippets in which
hopefully someone will spot something I've completely missed....
<!--- the cfgrid --->
<cfgrid name="cart" sort="yes" appendkey="yes"
griddataalign="left" rowheaders="no" rowheaderalign="left"
colheaders="yes" colheaderalign="left" selectmode="edit" maxrows="1"
enabled="yes" visible="yes" format="flash" autowidth="true">
<!--- Invisible columns --->
<cfgridcolumn name="ColourID" select="no" display="no">
<cfgridcolumn name="SizeID" select="no" display="no">
<cfgridcolumn name="RollLength" select="no" display="no">
<cfgridcolumn name="RollWidth" display="no" select="no">
<cfgridcolumn name="ItemTotal" select="no" display="no">
<cfgridcolumn name="ListPrice" select="no" display="no">
<!--- Visible columns --->
<cfgridcolumn name="Quantity" header="Qty"
headeralign="left" dataalign="center" width="20" select="no" display="yes">
<cfgridcolumn name="Product" headeralign="left"
dataalign="left" select="no" display="yes">
<cfgridcolumn name="MaterialSize" header="Material Size"
width="83" headeralign="left" dataalign="left" select="no" display="yes">
<cfgridcolumn name="UnitPrice" header="Unit"
headeralign="left" dataalign="left" width="50" bold="no" italic="no"
select="no" display="yes" headerbold="no" headeritalic="no">
<cfgridcolumn name="Price" header="Total" headeralign="left"
dataalign="left" width="50" bold="no" italic="no" select="no"
display="yes" headerbold="no" headeritalic="no">
</cfgrid>
<!--- Adding items to the grid --->
function addCartItem():Void {
var thisRollType = FullRoll.selectedData;
var thisSizeID = 0;
var thisMaterialSize = '';
if (thisRollType == "Full") {
thisSizeID=RollSize.selectedItem.size_id;
thisMaterialSize = RollSize.selectedItem.sizedesc;
} else {
thisSizeID=RollWidth.selectedItem.size_id;
thisMaterialSize = RollWidth.selectedItem.sizedesc+' x
'+RollLength.text+'m';
}
// List Price is actually the unformatted Net Price
cart.addItem({ColourID:OrderForm.ColourID.selectedItem.data,
SizeID:thisSizeID,
RollLength:thisRollType=="Full"?0:RollLength.text,
RollWidth:thisRollType=="Full"?0:RollWidth.selectedItem.sizedesc,
Product:OrderForm.ProductInfo,
Quantity:OrderForm.Quantity,
Price:OrderForm.TotalPrice,
ItemTotal:OrderForm.ItemTotal,
MaterialSize:thisMaterialSize,
UnitPrice:OrderForm.UnitPrice,
ListPrice:OrderForm.ListPrice});
}
<!--- sending the grid and all the rest of the form data to the cfc --->
myService = connection.getService(_global.servicePath, responseHandler );
myService.sendOrder(_global.dsn,_global.AccountNo,cart.dataProvider,Carriage.selectedItem.carriageid,Carriage.selectedItem.carriagecost,DeliveryAddressID,ContactName.text,ContactTel.text,CustomerOrderNo.text,DeliveryNotes.text,_global.OrderEmailAddress);
<!--- Quantity is one of the visible fields that comes back as
undefined in the struct, but yet this line below will display the
contents of the Quantity field --->
alert(cart.dataProvider[0].Quantity);
<!--- here's the head of the cfc method called with a dump of the cart
argument to file --->
<cffunction name="sendOrder" access="remote" returntype="struct"
displayname="send the order off">
<cfargument name="DSN" type="string" required="yes"
hint="Datasource to be queried">
<cfargument name="AccountNo" type="numeric" required="yes"
hint="William Smith Customer Account No">
<cfargument name="Cart" type="any" required="yes" default=""
hint="The cart from the form">
<cfargument name="CarriageID" type="numeric" required="yes"
hint="CarriageID from the form">
<cfargument name="CarriageCost" type="numeric" required="yes"
hint="Cost of the Carriage after discounts">
<cfargument name="DeliveryAddressID" type="numeric"
required="yes" hint="DeliveryAddressID">
<cfargument name="ContactName" type="string" required="yes"
hint="Contact Name">
<cfargument name="ContactTel" type="string" required="yes"
hint="Contact Tel No">
<cfargument name="CustomerOrderNo" type="string" required="yes"
hint="Customer ORder Number">
<cfargument name="DeliveryNotes" type="string" required="yes"
hint="Delivery Notes">
<cfargument name="OrderEmailAddress" type="string"
required="yes" hint="Email Address to which orders will be sent">
<cfset var locals = StructNew()>
<cfsavecontent variable="locals.dump">
<cfdump var="#arguments.cart#">
</cfsavecontent>
<cffile action="write" addnewline="yes"
file="#GetDirectoryFromPath(expandpath('*.*'))#/cartdump_#dateformat(now(),"yyyymmdd")#_#timeformat(now(),"HHMMSS")#.html"
output="#locals.dump#" fixnewline="no">
<!--- and here is the output from that dump --->
http://mrnil.pwp.blueyonder.co.uk/cartdump_20051010_162947.html
At my wits end....
I should add that this has been working before and after the
installation of the CFMX 7 Updater.
Stephen
PS. Sorry for the cross post.... :-/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220591
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54