I would like advice on perlish, and ideally Catalyst-y ways, to create a web interface to display interactive tree data structures, pulling from an underlying db. The db data underlying the tree would look like this, and the web page should have an interface similar to this. That was from an ms-access form discussed here. The form (some kind of active x thing I think) has a lot of bells and whistles: nodes open up when you click on the plus, you can specify how many levels the tree should expand to, etc.

I don't expect a web interface to have the kind of flash that the access form had, but how close can I get? Is there any hope of approaching this kind of prettiness/functionality with a pre-cooked catalyst helper? Or some other way to do this with catalyst/perl? Maybe even with this newfangled AJAX thing, or something?

If possible, I would like to be able to insert new nodes into the tree from the web interface. I do *not* need to be able to rearrange existing nodes, or delete nodes/trees. (If there's functionality to do this, great, just for my purposes I probably wouldn't be needing this.)

If there are no perlish modules/sample apps that already do this, I would also appear pointers to solutions that do this in other non-perl (but still webby) ways.

PS I have started a bookmark collection on implementing trees from an underlying db, and will update this with good tips I get from any ensuing perlmonks discussion.

UPDATE: updated question to be more catalyst centric

UPDATE 2: From the catalyst list, Carl Franks advised me: You might check out Sam Tregar's HTML::PopupTreeSelect and the recent HTML::PopupTreeSelect::Dynamic which supports AJAX.

http://search.cpan.org/~samtregar/HTML-PopupTreeSelect-1.5/
http://search.cpan.org/~samtregar/HTML-PopupTreeSelect-Dynamic-1.0/

As far as I remember, it has hardcoded HTML and restricts you to HTML::Template - but the code may be useful, as might the JS library he uses.

Carl

UPDATE 3: I've narrowed my googling down to "perl treeview," and that is getting better results. Perl Treeview Project using an Array of Hashes buffering a MySQL Database isn't catalyst, but it looks like a good place to start.

UPDATE 4: Found another example of trees in cgi at A Tree Grows in Perl

UPDATE 5: DHTML Tree: not perl, not catalyst, but real simple, and I like that. Maybe I could get this working from the db by modifying the javascript somehow. However, I haven't worked with dhtml, but I am dimly suspecting there is a dark side... browser compatatibility? something. more research needed...


In reply to Catalyst Interface to Display Tree Structure Pulled from DB. by tphyahoo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.