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