Re: [cgiapp] Ajax and JSON recipe

2009-04-11 Thread Bruce McKenzie
That's how I do it, too. JSON.pm does the outgoing conversion: sub get_json { my $perl_data_structure = shift; use JSON; # imports objToJson return objToJson( $perl_data_structure ); } jQuery has lots of tools for handling incoming JSON and for sending form data to CGI::Application

Re: [cgiapp] Ajax and JSON recipe

2009-04-11 Thread Michael Peters
Lyle Brooks wrote: Does anyone have a short starter example of code (both server and client) that they would be willing to post/share that would show Ajax/JSON usage with CGI::Application? The client is just Javascript and it's best to pick a framework to handle all the messy browser

Re: [cgiapp] Ajax and JSON recipe

2009-04-11 Thread Ron Savage
Hi Folks On Thu, 2009-04-09 at 10:20 -0500, P Kishor wrote: On Thu, Apr 9, 2009 at 9:53 AM, Lyle Brooks bro...@deseret.com wrote: I have a need to incorporate Ajax calls with JSON data into our application. I was looking for something in terms of a piece of starter code or a recipe. I

Re: [cgiapp] Ajax and JSON recipe

2009-04-11 Thread Ron Savage
Hi Lyle I've written a new module, CGI::Application::Demo::Ajax, which is a small search engine to retrieve records via Ajax and Json. I'll document it next and release it to CPAN. -- Ron Savage r...@savage.net.au http://savage.net.au/index.html # CGI::Application community mailing list

Re: [cgiapp] Ajax and JSON recipe

2009-04-11 Thread fREW Schmidt
I have a need to incorporate Ajax calls with JSON data into our application. I was looking for something in terms of a piece of starter code or a recipe. I didn't see anything on the website related to it. CGI Application seems like such a robust framework, that this should be a natural

Re: [cgiapp] Ajax and JSON recipe

2009-04-09 Thread P Kishor
On Thu, Apr 9, 2009 at 9:53 AM, Lyle Brooks bro...@deseret.com wrote: I have a need to incorporate Ajax calls with JSON data into our application.  I was looking for something in terms of a piece of starter code or a recipe.  I didn't see anything on the website related to it. CGI

Re: [cgiapp] Ajax app using CAP -- return JSON or HTML?

2008-05-24 Thread Ron Savage
Hi Mark I'm at a crossroad: should the CAP-based back-end normally return JSON data (and let the javascript library (I've decided on jQuery) place and format the data on the page), or should the back-end normally return HTML (via html templates), which will be dropped into different,

Re: [cgiapp] Ajax app using CAP -- return JSON or HTML?

2008-05-24 Thread Stewart Heckenberg
I'm at a crossroad: should the CAP-based back-end normally return JSON data (and let the javascript library (I've decided on jQuery) place and format the data on the page), or should the back-end normally return HTML (via html templates), which will be dropped into different, say, divs?

Re: [cgiapp] Ajax

2006-12-30 Thread Stewart Heckenberg
I've been using CGI::Ajax with CGI::Application, and I'm curious to know what you have in mind. At the moment I don't have a grasp of what the plugin would bring to the table. Perhaps you could elaborate? Well I was thinking of just making using CGI::Ajax via CGI::Application more

RE: [cgiapp] Ajax

2006-12-30 Thread Dan Horne
From: Stewart Heckenberg Sent: Saturday, 30 December 2006 10:22 p.m. I've been using CGI::Ajax with CGI::Application, and I'm curious to know what you have in mind. At the moment I don't have a grasp of what the plugin would bring to the table. Perhaps you could elaborate? Well I

Re: [cgiapp] Ajax

2006-10-12 Thread Sean Davis
On Thursday 12 October 2006 09:01, Robert Hicks wrote: I know this is sad. What is the term I should be looking for when I want to bring back only the associated records with a drop down selection? I assume you mean What AJAX command do I use?. That depends on the javascript framework you

Re: [cgiapp] Ajax?

2005-10-19 Thread Ron Savage
On Tue, 18 Oct 2005 23:55:15 -0700, Tim Colson \(tcolson\) wrote: Hi Tim Of course, you could always try CGI::Explorer: http://search.cpan.org/~rsavage/CGI-Explorer-2.05/ -- Cheers Ron Savage, [EMAIL PROTECTED] on 19/10/2005 http://savage.net.au/index.html Let the record show: Microsoft is not

Re: [cgiapp] Ajax?

2005-10-19 Thread Ron Mahoney
On Tue, Oct 18, 2005 at 11:55:15PM -0700, Tim Colson (tcolson) wrote: Say, has anyone got a minimal example of embedding AJAX into a CGI::APP, preferably using some library to abstract the Javascript (CGI::Ajax or SAJAX or something else) ?

RE: [cgiapp] Ajax?

2005-10-19 Thread Jesse Erlbaum
Hey Tim -- Say, has anyone got a minimal example of embedding AJAX into a CGI::APP, preferably using some library to abstract the Javascript (CGI::Ajax or SAJAX or something else) ? I'm sure a few other people will email you examples of AJAX implementations. I just wanted to make one

Re: [cgiapp] Ajax?

2005-10-19 Thread Michael Peters
Jesse Erlbaum wrote: Hey Tim -- Say, has anyone got a minimal example of embedding AJAX into a CGI::APP, preferably using some library to abstract the Javascript (CGI::Ajax or SAJAX or something else) ? I'm sure a few other people will email you examples of AJAX implementations. I

RE: [cgiapp] Ajax?

2005-10-19 Thread Barry Moore
Well, I'm not writing from experience since I have yet to find the time to play with it, but Cees Hek's plugin for the HTML::Prototype library ( CGI::Application::Plugin::HTMLPrototype) supplies a JavaScript library for doing Ajax stuff like autocomplete and plenty more. Don't know if you could

RE: [cgiapp] Ajax?

2005-10-19 Thread Jesse Erlbaum
I completely agree. I wonder how hard this AJAX transition will be for frameworks that rely on page-style sites. I can see it now: A separate file for every function, and they will love it. (To be fair, in Java that will be three separate files for every function, plus a big honkin' EJB

RE: [cgiapp] Ajax?

2005-10-19 Thread Tim Colson \(tcolson\)
(To be fair, in Java that will be three separate files for every function, plus a big honkin' EJB library and an XML configuration file. And they will love it, too.) lol -- interesting idea of fair. Many of the java MVC frameworks are not all that different from CA in the amount of

RE: [cgiapp] Ajax?

2005-10-19 Thread Ron Savage
On Wed, 19 Oct 2005 16:18:55 -0400, Jesse Erlbaum wrote: Hi Jesse Your Javascript would make an HTTP request on timeout (for example, when the user stops typing for a couple seconds). That request would be internal, and would get back a line-delimited list of options, which would then be

Re: [cgiapp] Ajax?

2005-10-19 Thread Mark Fuller
From: Ron Savage [EMAIL PROTECTED] I don't use timeout, I send every char back to a Perl module (RPC.pm), which connects to the db, and then does: Isn't that a lot of resources for each character without *any* timeout? If it's not running in mod_perl (or one of the persistent perl environments)

Re: [cgiapp] Ajax?

2005-10-19 Thread Rhesa Rozendaal
Ron Savage wrote: (This Perl is from my Database.pm): # --- sub find_entity_via_keystrokes { my($self, $prefix) = @_; my($sql) = select entity_id, entity_name from entity where entity_name_key like lower('$prefix%') order by

Re: [cgiapp] Ajax?

2005-10-19 Thread Mark Fuller
From: Ron Savage [EMAIL PROTECTED] I don't use timeout, I send every char back to a Perl module (RPC.pm), which connects to the db, and then does: Ron, since AJAX is asynchronous, what are the risks that typing savag would result in 6 search results arriving back to the client out of order?

Re: [cgiapp] Ajax?

2005-10-19 Thread Ron Savage
On Thu, 20 Oct 2005 03:46:43 +0200, Rhesa Rozendaal wrote: Hi Rhesa I do hope you're in a tightly controlled environment, or that you're properly untainting and detoxifying $prefix. I'd suggest I should give a fuller answer to this, so... For beginners not familiar with what this detoxifying

Re: [cgiapp] Ajax?

2005-10-19 Thread Ron Savage
On Thu, 20 Oct 2005 03:46:43 +0200, Rhesa Rozendaal wrote: Hi Rhesa Isn't your like case-insensitive? I guess that might depend on the database engine. Under MySQL yes, but the code (also) runs primarily under Postgres. -- Cheers Ron Savage, [EMAIL PROTECTED] on 20/10/2005

Re: [cgiapp] Ajax?

2005-10-19 Thread Ron Savage
On Wed, 19 Oct 2005 19:35:07 -0700, Mark Fuller wrote: Hi Mark Ron, since AJAX is asynchronous, what are the risks that typing savag would result in 6 search results arriving back to the client out of order? (Maybe a search request reaches the server Well, yes, that may be possible. In

Re: [cgiapp] Ajax?

2005-10-19 Thread Ron Savage
On Wed, 19 Oct 2005 18:38:12 -0700, Mark Fuller wrote: Hi Mark Again, a fuller answer. I could see this as acceptable within an *intra*net (for an application with a known/limited number of users). Is that something you'd want to do for a public web site? It's on an intranet, with only ever