[Maypole-dev] CDBI::AsForm questions/bugs

From: Dave Howorth (dhoworth at mrc-lmb.cam.ac.uk)
Date: Mon Nov 15 2004 - 12:12:45 GMT


I have a couple of questions about CDBI::AsForm. I'm seeing behaviours
that look like bugs, but I'm not sure enough of the underlying code or
intended behaviour to be able to classify them as such. I'd appreciate
feedback as to whether these are problems with CDBI::AsForm that I ought
to bug report or not. These problems occur when Maypole uses
CDBI::AsForm to display an edit page.

(1) textarea attributes
=======================
AsForm is used by Maypole's edit template to generate the form widgets:

     item.to_field(col).as_XML;

For a text field, these calls generate a textarea like this:

     <textarea name="seq"> my value </textarea>

I don't believe this is valid xhtml, because rows and cols are required
attributes for the textarea element. Their absence appears to cause
layout problems in browsers. (The same is true for as_HTML, BTW). The
markup is generated by HTML::Element but I don't know whether it should
be generating these attributes automatically or whether AsForm should be
adding them? Or something else?

(2) inflated columns
====================
If the value of a column has been inflated to an object using CDBI's
has_a, something like this:

   My::Table->has_a(column => 'my_class', deflate => 'deflate');

then AsForm pushes a reference to a my_class object into the
HTML::Element as the value of the content instead of stringifying my
object and pushing the text into the element's content. The result is
that nothing gets displayed. Again, I don't know whether this is an
HTML::Element issue, a CDBI::AsForm issue or in this case something I've
done wrong. I had previously asked about this on the CDBI list but my
question never got resolved. See these messages (first has full code,
second includes a fix that seems to work):

http://groups.kasei.com/mail/arc/cdbi-talk/2004-10/msg00232.html
http://groups.kasei.com/mail/arc/cdbi-talk/2004-10/msg00251.html

Cheers, Dave

_______________________________________________
maypole-dev mailing list
maypole-dev at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole-dev



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT