Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Click and Drag Functionality in Web Apps with Perl

by monkfan (Curate)
on Oct 11, 2006 at 10:55 UTC ( [id://577583]=perlquestion: print w/replies, xml ) Need Help??

monkfan has asked for the wisdom of the Perl Monks concerning the following question:

Some recent webapps like Kiko, Google's gadget, and spreadsheets to name a few, have this functionality.

I wonder how can this funcitonalities be implemented in Perl. Do you guys have any experience with it?
Any CPAN module that support that?

Regards,
Edward
  • Comment on Click and Drag Functionality in Web Apps with Perl

Replies are listed 'Best First'.
Re: Click and Drag Functionality in Web Apps with Perl
by Fletch (Bishop) on Oct 11, 2006 at 11:06 UTC

    It's done using Javascript frameworks like script.aculo.us and Rico. While you certainly can use Perl to generate code calling them on the fly, it's 80% client side (with 20% server side sending back HTML snippets in response to callbacks from the Javascript).

Re: Click and Drag Functionality in Web Apps with Perl
by xdg (Monsignor) on Oct 11, 2006 at 11:21 UTC

    As others have said, it's Javascript, but there are modules for working with it, either setting up the client-side scripts or processing the requests. For example, see HTML::Prototype and CGI::Ajax.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: Click and Drag Functionality in Web Apps with Perl
by dorward (Curate) on Oct 11, 2006 at 11:07 UTC

    It can't be implemented in Perl (well, unless you count the IE-only, plugin dependent, rarely installed, client-side PerlScript which might have the functionality).

    To handle drag and drop you need the client to support it, and that means JavaScript. The JavaScript can then send the results of the action (e.g. Foo was dropped onto Bar) back to the server in whatever format you like and the data can be processed with Perl - but that's the trivial bit of the equation.

Re: Click and Drag Functionality in Web Apps with Perl
by imp (Priest) on Oct 11, 2006 at 11:12 UTC
    The role that perl would play in this sort of thing is minimal.

    To do this you need javascript, and ajax or similar if you want to have dynamic or lazily loader content.

    Here is an example of javascript for dragging components:
    draggable iframes at javascripttoolbox.com

Re: Click and Drag Functionality in Web Apps with Perl
by fmerges (Chaplain) on Oct 12, 2006 at 07:53 UTC

    Hi,

    I recommend you using Dojo, and there's also the Turboajax if you need more advanced things not provided directly by Dojo.

    There's also the Yahoo YUI

    Regards,

    fmerges at irc.freenode.net
      Thanks,
      Do you have any experience working with Dojo and Turboajax with Perl? Especially there are CPAN modules like: HTML::Dojo or CGI::Ajax.

      How is the performance?

      Regards,
      Edward

        Hi,

        I wouldn't use them, just go to the sites and download that stuff, and put it into the static dir if you're using some kind of MVC framework...

        Yes, I'm using Dojo for some projects, need to get more into it to get the full power of it, but yes, I'm using it, and is very simple, once you have an initial idea, it's lacking a bit of docs, but the essential things are documented, and for the other, you only need to take a look at the js code ot get the idea...

        Well, performance is good, I like it, and in my humble opinion, the library is better than Prototype and rico.

        Regards,

        fmerges at irc.freenode.net

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://577583]
Approved by xdg
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found