Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfml2js with multiple returns?

Status
Not open for further replies.

rcp032

Technical User
Sep 21, 2006
44
US
Is there a way to send multipe variables through a cfml2js call at one time? I am sending an object with an embedded array, but I would like to send a single integer at the same time without having to embed it into the data object.
 
maybe im not getting you, but why don't you just write that single js var out to the page as you normally would? cfwddx cfml to js is great for creating JS objects, not single vars - even if it could do it, there's really no reason for it.

=========================================
Don't sweat the petty things and don't pet the sweaty things.
 
The problem is it is asynchronous. So the user can request a query which comes back in a cfml2js. Then they can request another and another etc. The only way to co-ordinate the query with the request is to send them both back at the same time.

The query results are assembled via a cf-loop into an object. It only seems reasonable to want to send the query parameters into a separate variable or object and send it back in the same request/response as I mentioned to keep them synchronized.

After all, it doesn’t seems that it would have been too difficult to add this functionality to cfml2js – to return two objects at the same time – just a matter of syntax after all. But I guess they didn’t see the need cause I just can’t make it work or find a hint that it might work.
 
well i don't really get what you're doing here without some code examples, i'm assuming your talking about some sort of ajaxian application if the issue is concurrency. if that is the case then you must be returning your JS as a string to be evaluated before another request is made. if so then there should be no harm just declaring the variable in the same place as your cfwddx tag (since it will also be evaluated). it still seems trivial to want to send 2 objects back instead of 1 top level object with 1 nested object for each response you want to send back. that is the purpose of objects after all.

The query results are assembled via a cf-loop into an object.

This can be interpreted a few different ways so maybe i'm way off base on this.

=========================================
Don't sweat the petty things and don't pet the sweaty things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top