Re: Coldfusion 8 and AJAX

2007-08-27 Thread Raymond Camden
I could be wrong - but I think Andy is wrong. I believe you can only
return the simple values - not the structure.

Yeah - so ajaxproxy is pretty cool. It has two very distinct, very
different features. On one hand it can make a simple connection
between your JS and your CFC code. On the other hand, it acts more
like a  tag, firing events based on other changes.

On 8/27/07, benjamin schwartz <[EMAIL PROTECTED]> wrote:
> Ray you are right and you described exactly what i wanted to do - even the
> idea of building a drop down if there are several "johns".
> I'm going to look into cfajaxproxy. I want to try what Andy suggest too
> though - returning a structure.
>
>
> Any other ideas?

-- 
===
Raymond Camden, Camden Media

Email: [EMAIL PROTECTED]
Blog  : www.coldfusionjedi.com
AOL IM : cfjedimaster

Keep up to date with the community: http://www.coldfusionbloggers.org

~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287222
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Coldfusion 8 and AJAX

2007-08-27 Thread benjamin schwartz
Actually i don't think that returning a struct would work 'cause the widget
itself (aka the cfinput box) doesn't know what to do with that result set.
I'll play around with cfajaxproxy - although i'm not sure that it will fix
my problem

On 8/27/07, benjamin schwartz <[EMAIL PROTECTED]> wrote:
>
> Ray you are right and you described exactly what i wanted to do - even the
> idea of building a drop down if there are several "johns".
> I'm going to look into cfajaxproxy. I want to try what Andy suggest too
> though - returning a structure.
>
>
> Any other ideas?
>
> Thanks already for your help.
>
> Ben
>
> On 8/27/07, Raymond Camden <[EMAIL PROTECTED] > wrote:
> >
> > So if I read you right - what you want is NOT the autosuggest feature
> > itself - or actually - you want to do something AFTER the user has
> > picked a value. Ie, I type in "Ra", your autocomplete returns a set of
> > possibilities, one of which is "Ray", I select Ray, you then load your
> > other form fields with info about Ray.
> >
> > If so - I'd recommend using cfajaxproxy with a bind that points to
> > clientName. You can tell ajaxProxy to run a CFC function whenever
> > clientName changes, which is what will happen when the user picks one
> > of the values you select.
> >
> > There is a problem with this though. Lets say your autosuggest is
> > looking up names in a Contacts table. I type in "J" and get John.
> > There could be two Johns in the table. You aren't allowed to return
> > complex data, just the string. So if I do the lookup based on John, it
> > would only work for one record.
> >
> > Of course, you could build in support for this as well. I could
> > imagine a detail form that would support showing a drop down of all
> > the Johns.
> >
> > So does this help? I could try to whip up a demo later today.
> >
> >
> > On 8/27/07, Ben S <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > I'm experimenting with the AJAX stuff that was added with CF 8 and i'm
> > running in the following issue - i wonder if anyone played around with it
> > and could help me.
> > >
> > > I have a cfform:
> > > 
> > > Client name:  > autosuggest="cfc:company.lookupCompany({cfautosuggestvalue})">
> > > 
> > >
> > > and a cfc to populate it with data :
> > >
> > > 
> > >  > returntype="any">
> > > 
> > > 
> > > 
> > > select * from clients where clientName
> > like '#ARGUMENTS.search#%' order by clientName
> > > 
> > > 
> > > 
> > > 
> > >
> > > So far nothing spectacular - I actually got this from Ben Forta's
> > tutorial. What i would like to do is to add fields in the form and for the
> > data to be auto populated if a record for that clientName exists in the
> > database.
> > > With the current syntax  i get an error message:
> > error:widget: Bind failed for autosuggest clientName, bind value is not a 1D
> > array of strings which i don't know how to fix.
> > > If i write  instead it works
> > fine but then i don't know how i would populate other form fields.
> > >
> > > Any help would be appreciated.
> > >
> > > Thank you in advance
> > >
> > > Ben
> > >
> > >
> >
> > 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287221
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Coldfusion 8 and AJAX

2007-08-27 Thread benjamin schwartz
Ray you are right and you described exactly what i wanted to do - even the
idea of building a drop down if there are several "johns".
I'm going to look into cfajaxproxy. I want to try what Andy suggest too
though - returning a structure.


Any other ideas?

Thanks already for your help.

Ben

On 8/27/07, Raymond Camden <[EMAIL PROTECTED]> wrote:
>
> So if I read you right - what you want is NOT the autosuggest feature
> itself - or actually - you want to do something AFTER the user has
> picked a value. Ie, I type in "Ra", your autocomplete returns a set of
> possibilities, one of which is "Ray", I select Ray, you then load your
> other form fields with info about Ray.
>
> If so - I'd recommend using cfajaxproxy with a bind that points to
> clientName. You can tell ajaxProxy to run a CFC function whenever
> clientName changes, which is what will happen when the user picks one
> of the values you select.
>
> There is a problem with this though. Lets say your autosuggest is
> looking up names in a Contacts table. I type in "J" and get John.
> There could be two Johns in the table. You aren't allowed to return
> complex data, just the string. So if I do the lookup based on John, it
> would only work for one record.
>
> Of course, you could build in support for this as well. I could
> imagine a detail form that would support showing a drop down of all
> the Johns.
>
> So does this help? I could try to whip up a demo later today.
>
>
> On 8/27/07, Ben S <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I'm experimenting with the AJAX stuff that was added with CF 8 and i'm
> running in the following issue - i wonder if anyone played around with it
> and could help me.
> >
> > I have a cfform:
> > 
> > Client name:  autosuggest="cfc:company.lookupCompany({cfautosuggestvalue})">
> > 
> >
> > and a cfc to populate it with data :
> >
> > 
> >  returntype="any">
> > 
> > 
> > 
> > select * from clients where clientName
> like '#ARGUMENTS.search#%' order by clientName
> > 
> > 
> > 
> > 
> >
> > So far nothing spectacular - I actually got this from Ben Forta's
> tutorial. What i would like to do is to add fields in the form and for the
> data to be auto populated if a record for that clientName exists in the
> database.
> > With the current syntax  i get an error message:
> error:widget: Bind failed for autosuggest clientName, bind value is not a 1D
> array of strings which i don't know how to fix.
> > If i write  instead it works fine
> but then i don't know how i would populate other form fields.
> >
> > Any help would be appreciated.
> >
> > Thank you in advance
> >
> > Ben
> >
> >
>
> 

~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287220
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Coldfusion 8 and AJAX

2007-08-27 Thread Andy Matthews
Without having looked at Ben's tute, you might consider returning a
structure instead of a query or a string. Then you could bring back multiple
bits of data in the same variable.


andy

-Original Message-
From: Ben S [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 27, 2007 1:49 PM
To: CF-Talk
Subject: Coldfusion 8 and AJAX

Hi,

I'm experimenting with the AJAX stuff that was added with CF 8 and i'm
running in the following issue - i wonder if anyone played around with it
and could help me.

I have a cfform: 

Client name: 


and a cfc to populate it with data : 






select * from clients where clientName like
'#ARGUMENTS.search#%' order by clientName





So far nothing spectacular - I actually got this from Ben Forta's tutorial.
What i would like to do is to add fields in the form and for the data to be
auto populated if a record for that clientName exists in the database. 
With the current syntax  i get an error message:
error:widget: Bind failed for autosuggest clientName, bind value is not a 1D
array of strings which i don't know how to fix. 
If i write  instead it works fine but
then i don't know how i would populate other form fields.

Any help would be appreciated. 

Thank you in advance

Ben 



~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287219
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Coldfusion 8 and AJAX

2007-08-27 Thread Raymond Camden
So if I read you right - what you want is NOT the autosuggest feature
itself - or actually - you want to do something AFTER the user has
picked a value. Ie, I type in "Ra", your autocomplete returns a set of
possibilities, one of which is "Ray", I select Ray, you then load your
other form fields with info about Ray.

If so - I'd recommend using cfajaxproxy with a bind that points to
clientName. You can tell ajaxProxy to run a CFC function whenever
clientName changes, which is what will happen when the user picks one
of the values you select.

There is a problem with this though. Lets say your autosuggest is
looking up names in a Contacts table. I type in "J" and get John.
There could be two Johns in the table. You aren't allowed to return
complex data, just the string. So if I do the lookup based on John, it
would only work for one record.

Of course, you could build in support for this as well. I could
imagine a detail form that would support showing a drop down of all
the Johns.

So does this help? I could try to whip up a demo later today.


On 8/27/07, Ben S <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm experimenting with the AJAX stuff that was added with CF 8 and i'm 
> running in the following issue - i wonder if anyone played around with it and 
> could help me.
>
> I have a cfform:
> 
> Client name:  autosuggest="cfc:company.lookupCompany({cfautosuggestvalue})">
> 
>
> and a cfc to populate it with data :
>
> 
> 
> 
> 
> 
> select * from clients where clientName like 
> '#ARGUMENTS.search#%' order by clientName
> 
> 
> 
> 
>
> So far nothing spectacular - I actually got this from Ben Forta's tutorial. 
> What i would like to do is to add fields in the form and for the data to be 
> auto populated if a record for that clientName exists in the database.
> With the current syntax  i get an error message: error:widget: 
> Bind failed for autosuggest clientName, bind value is not a 1D array of 
> strings which i don't know how to fix.
> If i write  instead it works fine but 
> then i don't know how i would populate other form fields.
>
> Any help would be appreciated.
>
> Thank you in advance
>
> Ben
>
> 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287218
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Coldfusion 8 and AJAX

2007-08-27 Thread Ben S
Hi,

I'm experimenting with the AJAX stuff that was added with CF 8 and i'm running 
in the following issue - i wonder if anyone played around with it and could 
help me.

I have a cfform: 

Client name: 


and a cfc to populate it with data : 






select * from clients where clientName like 
'#ARGUMENTS.search#%' order by clientName





So far nothing spectacular - I actually got this from Ben Forta's tutorial. 
What i would like to do is to add fields in the form and for the data to be 
auto populated if a record for that clientName exists in the database. 
With the current syntax  i get an error message: error:widget: 
Bind failed for autosuggest clientName, bind value is not a 1D array of strings 
which i don't know how to fix. 
If i write  instead it works fine but then 
i don't know how i would populate other form fields.

Any help would be appreciated. 

Thank you in advance

Ben 

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287217
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4