On 5/25/07, James Masters <[EMAIL PROTECTED]> wrote:
> When I asked can I put the metadata of a DB column into an HTML Object
> somehow and it would automatically create
> the appropriate html form element, you said: [...]
>
> So does this mean that the answer is no but instead I can define my own HTML
> object for each type of column.  And then the html object can be used to
> create forms and validate form input by simply assigning each DB column object
> to the appropriate HTML object?

There is no preexisting mapping between RDBO column types and RHTMLO
field types, nor is there a method that takes a column and gives you
an appropriate field.  But it's not hard to write one, since both RDBO
columns and RHTMLO fields have name/class mappings:

http://search.cpan.org/dist/Rose-HTML-Objects/lib/Rose/HTML/Form.pm#field_type_classes

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm#column_type_classes

> If so, I can see the benefit of this because one person might want to do their
> date form one way and another person differently  - so forcing a form for date
> column types to be a particular format, as I was suggesting, is not ideal.

Right, that's why there's no default way to do this built in.

-John

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to