Re: Ajaxcfc newbe problems (2)

2007-01-03 Thread Christopher Jordan
Ioannis,

Several folks on the ajaxCFC mailing list have commented on 
documentation like you suggest, but nobody (as far as I know; myself 
included) has stepped up to the plate to help Rob with documentation 
despite a desire to do so. I'm guessing that folks are just really busy. 
I agree that some time should be made for documentation.

As for debugging your code, all you did to the code you posted below was 
change this:

function jsReturn(r) {
sDumper(r);
}

to this:
function jsReturn(r) {
document.write(r);
}

 and that's all? That produces the error you got? Hmm... what does firebug 
say? What version of firebug are you using? If you're not using the beta, you 
might want to grab it from getfirebug.org... it's very slick.

I'd be interested to know what it has to say. Have you tried this in IE? Does 
it produce similar results?

What happens if you replace document.write(r) with alert(r)? BTW, I'm not sure 
anyone uses document.write for much. I could be wrong there, though. 

Cheers,
Chris




Ioannis Papanikolaou wrote:
 Hello everyone for once again,

 After the extremely helpful comments of Dan (the fireGub enlightment) and, 
 Chris and Jordan on the actual use of ajaxCFC, I have manage to move on 
 another issue. The idea   of Ajax is quite clear at the moment in my head and 
 I have manage to make a request to the server, receive a response and handle 
 it  almost. 

 The following example worked 100% ok:

 test.cfc

 cfcomponent extends=ajax
   
   cffunction name=GetCurrentTime returntype=string output=true
 cfset var szTime = TimeFormat(Now(), h:mm:ss tt)
 cfsavecontent variable=jsReturncfoutput
   Aftin tin ora:#szTime# Ton lene h1PSILO/h1
   /cfoutput/cfsavecontent
   cfreturn jsReturn /
 /cffunction
   

 /cfcomponent
 - - - - - - - 

 test.cfm

 !--script type=text/javascript
   function content()  {
   // send data to CF
   DWRUtil.useLoadingMessage();
   
 DWREngine._execute(_ajaxConfig._cfscriptLocation, null, 'GetCurrentTime', 
 null, jsReturn);
   }
   
   function jsReturn(r) {
  sDumper(r);
  }
   /script
 /head
 body
 a href=#class=linksonClick='content();'pos ton lene/a/li--
 - - - - 

 When I am trying to replace the sDumper(r) with document.write(r);

 then I am getiing the most unsuall alert message 
 typeError: $(disabledZone)has no properties and even though the requested 
 content displayed the browser keeps loading for ever and freezes (you cannot 
 refresh it). 

 I ve check the internet for the error but no much of a result.

 Any ideas more than welcome.

 ( I am thinking to document a Ajaxcfc newbie problems trilogy ) 

 Please participate

 hahaha

 thanx Ioannis







 

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


Re: Ajaxcfc newbe problems (2)

2007-01-03 Thread Ioannis Papanikolaou
It works smoothly with alert(r);

Any other way to try to display it ?( what I want to do is to display the 
results of the output form my server to a specific DIV on my first page. The 
page is kind of dynamic content displaying info).

I am using the Beta version as you said. The errors I am getiing are:

a)On the console tag: the request field is keep loading for ever even thought 
the requested content has been dispalyed in my screen already.

b)On the Script tag the debbuger has stoped on util.js, line 271 
$('disabledZone').style.visibility = 'hidden';

this probably produses the alert I had mention before. 

Do you think my javascript synatax is wrong (my level is quite basic on 
Javascript)

Thanx a a lot

Ioannis   

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


RE: Ajaxcfc newbe problems (2)

2007-01-03 Thread loathe
Replace document.write(r);

With

DWRUtil.setValue(myDivName,r);

Does that work?

 -Original Message-
 From: Ioannis Papanikolaou [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 03, 2007 3:49 PM
 To: CF-Talk
 Subject: Re: Ajaxcfc newbe problems (2)
 
 It works smoothly with alert(r);
 
 Any other way to try to display it ?( what I want to do is to display the
 results of the output form my server to a specific DIV on my first page.
 The page is kind of dynamic content displaying info).
 
 I am using the Beta version as you said. The errors I am getiing are:
 
 a)On the console tag: the request field is keep loading for ever even
 thought the requested content has been dispalyed in my screen already.
 
 b)On the Script tag the debbuger has stoped on util.js, line 271
 $('disabledZone').style.visibility = 'hidden';
 
 this probably produses the alert I had mention before.
 
 Do you think my javascript synatax is wrong (my level is quite basic on
 Javascript)
 
 Thanx a a lot
 
 Ioannis
 
 

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


Re: Ajaxcfc newbe problems (2)

2007-01-03 Thread Ioannis Papanikolaou
Yeees, it worked it worked it worked it worked it worked.

Any suggested reading you have to reccomend on how to send and handle requestes 
with AjaxCFC would be more than welcome. As well the reason of why a simple 
document.write wouldnt work (in order to avoid similar mistakes in the future).


Thanx a lot guys for everything. 

Ioannis

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


Re: Ajaxcfc newbe problems (2)

2007-01-03 Thread Robertson-Ravo, Neil (RX)
I would also read up on the basic principle of ajax as well, it will ho a
long way in helping you understand it all.






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: Ioannis Papanikolaou
To: CF-Talk
Sent: Wed Jan 03 21:45:48 2007
Subject: Re: Ajaxcfc newbe problems (2)

Yeees, it worked it worked it worked it worked it
worked.

Any suggested reading you have to reccomend on how to send and handle
requestes with AjaxCFC would be more than welcome. As well the reason of why
a simple document.write wouldnt work (in order to avoid similar mistakes in
the future).


Thanx a lot guys for everything. 

Ioannis



~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


Re: Ajaxcfc newbe problems (2)

2007-01-03 Thread Christopher Jordan
Ioannis,

I wouldn't spend a lot of time trying to figure out why document.write() 
isn't working for you. It's not what you want to use anyway.

What you want to do is manipulate the DOM to update portions of the 
screen dynamically -- at least it seems that's what you want. You can do 
this with JavaScript, but it's rather complicated, and given your stated 
level of experience with JavaScript I would suggest you look to a 
JavaScript library that is written specifically to make this sort of 
task easier.

My library of choice is jQuery (http://jQuery.com). It's fantastic. It 
has a very active and loyal community that are willing and able to 
answer any questions you'd like.

I'm coding something like what you're describing right now, and I'm 
using jQuery to accomplish it. In the past I would have used IE's 
innerHTML to get the job done, but that only works in IE (at least I 
don't think it works in FF).

(note this snippet is not a working piece of code)
ThisRow = ;
ThisRow += div class=\OrderEntryListRow  + RowClass + \ 
RowType=\ + RowClass + \\n;
ThisRow += span class=\Date Cell\ + ThisDate + /span \n;
ThisRow += span class=\CostCenter Cell\ + CostCenterName + 
/span \n;
ThisRow += span class=\ShiftName Cell\ + ShiftName + /span \n;
ThisRow += span class=\Classification Cell\ + Classification + 
/span \n;
ThisRow += span class=\Quantity Cell\ + Quantity + /span\n;
ThisRow += /div;
$(##OrderList).append(ThisRow);

You can see that I'm using normal JavaScript to create a string of HTML 
which is stored as a string in the variable ThisRow. I then use jQuery 
to append that string to an element. In this case that element is a div 
(not shown) with an ID of OrderList. In jQuery, you can match all 
elements that have a specific ID or class or attribute, etc. The 
#OrderList tells it to look for an element whose ID is OrderList. I'm 
using ## because I'm within ColdFusion cfoutput tags, so I need to 
escape the single #.
This is a very simple example, but it does what you're looking to do. 
jQuery also has ajax capability. In fact, the snippet above is in the 
middle of an ajax call -- it gets executed upon success of the call.

The other good news is that Rob Gonda will soon be releasing an AjaxCFC 
plug-in for jQuery! Yay! Right now, I've had to change the way I call 
CFCs in jQuery, but as soon at Rob's plug-in becomes publicly available 
it will change everything for ColdFusion jQuery users. I've been testing 
an advanced copy and it's pretty cool stuff.

So to sum up: my advice is to check out jQuery. Sign up for the mailing 
list (discuss@jQuery.com) here http://jquery.com/discuss/, and speak 
up. Folks are more than willing to help new comers.

I hope this helps.

Cheers,
Chris



Ioannis Papanikolaou wrote:
 It works smoothly with alert(r);

 Any other way to try to display it ?( what I want to do is to display the 
 results of the output form my server to a specific DIV on my first page. The 
 page is kind of dynamic content displaying info).

 I am using the Beta version as you said. The errors I am getiing are:

 a)On the console tag: the request field is keep loading for ever even thought 
 the requested content has been dispalyed in my screen already.

 b)On the Script tag the debbuger has stoped on util.js, line 271 
 $('disabledZone').style.visibility = 'hidden';

 this probably produses the alert I had mention before. 

 Do you think my javascript synatax is wrong (my level is quite basic on 
 Javascript)

 Thanx a a lot

 Ioannis   

 

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


Re: Ajaxcfc newbe problems (2)

2007-01-03 Thread Christopher Jordan
Robertson-Ravo, Neil (RX) wrote:
 I would also read up on the basic principle of ajax as well, it will ho a
 long way in helping you understand it all.
   
yup... I love those ajax books... best ho's around. They'll ho until 
from sun up 'til sundown...:o)
Cheers,
Chris

-- 
http://www.cjordan.info


~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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


RE: Ajaxcfc newbe problems (2)

2007-01-03 Thread Dave Watts
 As well the reason of why a simple document.write wouldnt 
 work (in order to avoid similar mistakes in the future).

When document.write() is called after the page has already been displayed to
the user, it rewrites the entire page. Set the innerHTML or innerText
properties of a block element instead, to rewrite the contents of that
element.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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