[Catalyst] AJAX with catalyst
Jonathan Rockway
jon at jrock.us
Sat May 12 20:48:39 GMT 2007
On Saturday 12 May 2007 06:36:05 am Dmitri Pissarenko wrote:
> Hello!
>
> I'm learning catalyst and have written a simple application, which
> lets user display, edit, add data to/from database.
>
> Now I want to make it more user-friendly by using some elements known
> from desktop apps:
>
> 1) Popup windows
> 2) Context menus
> 3) Panels, which I can drag from one place to another. That is, I have
> four panels (with different content) on a page, and I can change their
> places by dragging one panel to another place.
There are a variety of toolkits that will do this for you. Dojo is the most
advanced for desktop-style UIs. There's also YUI, GWT, mootools, mochikit,
jquery, and prototype. Don't use prototype unless you like to debug lots of
weird javascript problems.
Most of these toolkits want JSON back from your application, so you'll
probably want to set up a REST interface with Catalyst::Action::REST and use
that for the AJAX. Usually rendering to JSON is faster (both in render time
and transfer time) than rendering to HTML, so resist the urge to use AJAX
kits where you send fully-rendered HTML to the AJAX library. Just send the
data and let the rendering happen on the client side.
Finally, Jemplate (along with Catalyst::View::Jemplate) is a great way to push
the rendering of your Template Toolkit templates off to the client.
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070512/a3b49ed2/attachment.pgp
More information about the Catalyst
mailing list