Hi,<br><br>I've made a package of the current Instant development branch: <a href="http://zby.aster.net.pl/Catalyst-Example-InstantCRUD-v0.0.17.tar.gz">zby.aster.net.pl/Catalyst-Example-InstantCRUD-v0.0.17.tar.gz</a><br>- it includes the widget stuff.&nbsp; If anyone is interested I can explain things at #catalyst. 
<br>For now I am a bit stuck with the question about the interface.&nbsp; If I make it a subclass of HTML::Widget would it be considered bad form if I do something like:<br><br>...<br>package HTML::Widget::Result<br><br>sub save_to_db {
<br>...<br><br>adding effectively the save_to_db method to the HTML::Widget::Result objects?&nbsp; Or should I solve it in some other way?<br><br>--<br>Zbyszek<br>
<br><br><div><span class="gmail_quote">On 9/26/06, <b class="gmail_sendername">John Napiorkowski</b> &lt;<a href="mailto:jjn1056@yahoo.com">jjn1056@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm definitely interested in seeing what you come up<br>with.&nbsp;&nbsp;I'm not sure if any names I come up with are<br>useful though :)&nbsp;&nbsp;I also used DBIx::Class::Widget for<br>a little while but found as you that it was a little<br>
too much bound together which is why I'm using<br>formbuilder now (which has less glue to DBIx then I<br>would like, granted).<br><br>As far as the config file format, why not use<br>config::any and just let people choose the config of
<br>their choice?<br><br> --john<br><br><br><br>--- Zbigniew Lukasiak &lt;<a href="mailto:zzbbyy@gmail.com">zzbbyy@gmail.com</a>&gt; wrote:<br><br>&gt; Thanks for the ideas, I think I'll try them later -<br>&gt; for now the module is
<br>&gt; nearly ready it just needs some finishing touches. I<br>&gt; would like to finish it<br>&gt; and see if people use it before extending.&nbsp;&nbsp;What I<br>&gt; need now is to decide how<br>&gt; to name it and if make it a subclass of HTML::Widget
<br>&gt; - the creator would<br>&gt; record the config and db row in the object and then<br>&gt; the update would an<br>&gt; object method with no arguments.&nbsp;&nbsp;This would be the<br>&gt; simplest interface I see<br>&gt; - but unfortunately the update method needs to have
<br>&gt; a HTML::Widget::Result<br>&gt; object not a simple HTML::Widget - any ideas how to<br>&gt; cleanly solve that?<br>&gt;<br>&gt; All the logic for this module I've taken from<br>&gt; DBIx::Class::Widget (by Jonas<br>
&gt; Alves). We came to conclusion that it was coupling<br>&gt; the db and the interface<br>&gt; too strongly and I hope that the config will make<br>&gt; the coupling a bit more<br>&gt; loose.<br>&gt;<br>&gt; --<br>&gt; Zbyszek
<br>&gt;<br>&gt; On 9/25/06, Peter Edwards &lt;<a href="mailto:peter@dragonstaff.com">peter@dragonstaff.com</a>&gt;<br>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; The sort of interface I'd like would be a form<br>&gt; definition file, say in
<br>&gt; &gt; Config::General format, following a standard<br>&gt; syntax.<br>&gt; &gt; As a starting point it would be worth looking at a<br>&gt; Visual Basic .frm file<br>&gt; &gt; to<br>&gt; &gt; see the sort of info that stores.
<br>&gt; &gt; - general form level attributes, including data<br>&gt; source spec<br>&gt; &gt; - nested containers, both simple and tabbed<br>&gt; &gt; - labels<br>&gt; &gt; - widgets for display elements with optional link
<br>&gt; to data source element<br>&gt; &gt; - back in InstantCRUD an overrideable handler for<br>&gt; generalised form<br>&gt; &gt; handling<br>&gt; &gt; tasks (list paging, record view, record next/prev,<br>&gt; that sort of thing) and
<br>&gt; &gt; backends for AJAX widgets.<br>&gt; &gt;<br>&gt; &gt; Later on someone could write an Eclipse plugin to<br>&gt; make it easy to set up<br>&gt; &gt; forms. Valuable for proof of concept prototyping<br>&gt; and then you can fine
<br>&gt; &gt; tune<br>&gt; &gt; the form def or write custom TT2 templates where<br>&gt; necessary.<br>&gt; &gt; It also makes it easy to write a utility to allow<br>&gt; users to customise<br>&gt; &gt; screen<br>&gt; &gt; appearance.
<br>&gt; &gt;<br>&gt; &gt; Regards, Peter<br>&gt; &gt;<br>&gt; &gt; -----Original Message-----<br>&gt; &gt; From: <a href="mailto:html-widget-bounces@lists.rawmode.org">html-widget-bounces@lists.rawmode.org</a><br>&gt; &gt; [mailto:
<a href="mailto:html-widget-bounces@lists.rawmode.org">html-widget-bounces@lists.rawmode.org</a>] On<br>&gt; Behalf Of John<br>&gt; &gt; Napiorkowski<br>&gt; &gt; Sent: 24 September 2006 23:38<br>&gt; &gt; To: <a href="mailto:html-widget@lists.rawmode.org">
html-widget@lists.rawmode.org</a><br>&gt; &gt; Subject: Re: [Html-widget] Rails-like form helpers<br>&gt; - RFC for a new module<br>&gt; &gt;<br>&gt; &gt; --- Zbigniew Lukasiak &lt;<a href="mailto:zzbbyy@gmail.com">zzbbyy@gmail.com
</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; &gt; Dear all,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; In the new InstantCRUD I decided to take out the<br>&gt; &gt; &gt; code for html forms<br>&gt; &gt; &gt; generation and make a separate module for it.
<br>&gt; After<br>&gt; &gt; &gt; reading 'Rails-like<br>&gt; &gt; &gt; form helpers' thread I think that this module<br>&gt; might<br>&gt; &gt; &gt; find a more general use.<br>&gt; &gt; &gt; I would like to ask you what intefrace would you
<br>&gt; &gt; &gt; propose for it.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; It can build the HTML::Widgets based on some<br>&gt; config<br>&gt; &gt; &gt; and data from the<br>&gt; &gt; &gt; database and then can also save the data from
<br>&gt; the<br>&gt; &gt; &gt; widget to the database.<br>&gt; &gt; &gt; The config part is more complicated than it<br>&gt; could be<br>&gt; &gt; &gt; because the info about<br>&gt; &gt; &gt; many-to-many relations is not available from the
<br>&gt; &gt; &gt; schema so you need to<br>&gt; &gt; &gt; specify it in the config.&nbsp;&nbsp;Since it is already<br>&gt; there<br>&gt; &gt; &gt; I've added also the<br>&gt; &gt; &gt; stringification to it - as it is a bit cleaner
<br>&gt; to<br>&gt; &gt; &gt; have it here in the<br>&gt; &gt; &gt; interface part than overload stringification in<br>&gt; the<br>&gt; &gt; &gt; database schema<br>&gt; &gt; &gt; definition.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; The current interface is composed of just two
<br>&gt; &gt; &gt; functions:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt;<br>Catalyst::Example::InstantCRUD::Widget-&gt;make_widget($interface_config,<br>&gt; &gt; &gt; $class, $schema, $item);<br>&gt; &gt; &gt;
<br>&gt; &gt; &gt; $interface_config is a hash containing info<br>&gt; about<br>&gt; &gt; &gt; all db classes and how to<br>&gt; &gt; &gt; wigetify them, $class is the db class, $schema<br>&gt; is<br>&gt; &gt; &gt; DBIC schema and $item is
<br>&gt; &gt; &gt; the db row to populate values in the form - its<br>&gt; &gt; &gt; optional.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt;<br>Catalyst::Example::InstantCRUD::Widget-&gt;populate_db($result,<br>
&gt; &gt; &gt; $item);<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; $result is HTML::Widget::Result and $item is the<br>&gt; db<br>&gt; &gt; &gt; row to be updated<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; So my question is do you think it deserves to be
<br>&gt; &gt; &gt; taken out from InstantCRUD<br>&gt; &gt; &gt; and then what name would you propose for it?<br>&gt; How<br>&gt; &gt; &gt; would you design the API?<br>&gt; &gt;<br>&gt; &gt; I personally like the idea of having a config file
<br>&gt; for<br>&gt; &gt; this.&nbsp;&nbsp;One of the things that has really worked<br>&gt; for me<br>&gt; &gt; with Formbuilding is that option to use a yaml<br>&gt; &gt; configuration file to build forms.&nbsp;&nbsp;I didn't<br>&gt; &gt; personally like building the forms in the
<br>&gt; controller,<br>&gt; &gt; it really seems like a view thing to me, and<br>&gt; &gt; forwarding to a view to build the form and then to<br>&gt; &gt; Template Toolkit seemed really like a lot of extra<br>&gt; &gt; work.
<br>&gt; &gt;<br>&gt; &gt; With formbuilding I can put the config file in<br>&gt; with<br>&gt; &gt; the *.tt files and it seems really neat and<br>&gt; ordered to<br>&gt; &gt; me.<br>&gt; &gt;<br>&gt; &gt; Other things I'd like is an easier way to have the
<br>&gt; &gt; forms and other elements hook back to catalyst<br>&gt; &gt; controllers.&nbsp;&nbsp;I've really liked the JSF idea of<br>&gt; having<br>&gt; &gt; the template language be more than a renderer.<br>&gt; Makes<br>&gt; &gt; developing AJAX stuff easier.
<br>&gt; &gt;<br>&gt; &gt; So it would be very cool if instead of exposing<br>&gt; &gt; information to the template system you would<br>&gt; expose<br>&gt; &gt; objects with callbacks to controllers.&nbsp;&nbsp;However to<br>&gt; get
<br>&gt; &gt; this to work right we really need a better<br>&gt; subrequest<br>&gt; &gt; system.&nbsp;&nbsp;I've been playing with the subrequest<br>&gt; plugin<br>&gt; &gt; from Trunk just to get the idea of how this all<br>&gt; works
<br>&gt; &gt; but haven't made so much progress in understanding<br>&gt; it<br>&gt; &gt; all :)<br>&gt; &gt;<br>&gt; &gt; Right now for my portal like system I'm just<br>&gt; creating<br>&gt; &gt; objects that do dumb LWP requests to a controller.
<br>&gt;&nbsp;&nbsp;It<br>&gt; &gt; works but feels very crude.<br>&gt; &gt;<br>&gt; &gt; --john<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; Html-widget mailing list
<br>&gt; &gt; <a href="mailto:Html-widget@lists.rawmode.org">Html-widget@lists.rawmode.org</a><br>&gt; &gt;<br>&gt;<br><a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget">http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget
</a><br>&gt; &gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Zbigniew Lukasiak<br>&gt; <a href="http://brudnopis.blogspot.com/">http://brudnopis.blogspot.com/</a><br>&gt; &gt; _______________________________________________
<br>&gt; Html-widget mailing list<br>&gt; <a href="mailto:Html-widget@lists.rawmode.org">Html-widget@lists.rawmode.org</a><br>&gt;<br><a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget">http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget
</a><br>&gt;<br><br><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?&nbsp;&nbsp;Yahoo! Mail has the best spam protection around<br><a href="http://mail.yahoo.com">http://mail.yahoo.com</a><br>
<br>_______________________________________________<br>Html-widget mailing list<br><a href="mailto:Html-widget@lists.rawmode.org">Html-widget@lists.rawmode.org</a><br><a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget">
http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget</a><br></blockquote></div><br><br clear="all"><br>-- <br>Zbigniew Lukasiak<br><a href="http://brudnopis.blogspot.com/">http://brudnopis.blogspot.com/</a>