Interesting idea, and I think I like it, with one small qualm - isn't
it already the job of a view to act as a renderer, and wouldn't
creating another option for rendering (on top of the options available
of implementing render-object-view-impl for a new view or just
subclassing dataform and rewriting render-widget-body) be a bit
redundant?  It's already unclear to me who should be responsible for
rendering what - the view or the widget?

The heuristic I have used so far has been, roughly, that to render
generalized ways of laying things out when the form of the data itself
is unknown to me (something like just print a list of some data in a
table with each element in the list taking up a row - this general
model can be fit to any list of data), I use views to render it, and
to make very customized layouts based on the content of the data (like
a table of blog posts where I want the title and author of the blog to
appear in separate cells in the firs row, and the summary to appear in
a cell of colspan 2 in the second row), I create custom widgets and do
the rendering by hand in render-widget-body.  So do you see renderers
as being a way of generally formatting data or a way to make very
customized forms, and in either case, how are they much different from
making a new view type or just overriding render-dataform-form (or
render-dataform)?  It seems a bit confusing to me to create a new way
to render things unless there is another need here that I am missing.

Additionally, do you see renderers being something used only for the
dataform widget or something that might be used across other widgets
as well?  They mostly only make sense to me in the context of
dataforms, but just curious about what your thoughts are.

Thanks,
Saikat

On Mar 24, 3:47 am, "Leslie P. Polzer" <[email protected]> wrote:
> On Mar 24, 11:06 am, Saikat Chakrabarti <[email protected]> wrote:
>
> > When creating forms, I want to have all the input fields line up on
> > the left side, and as far as I know, the only way to do this well is
> > using a table to layout the form.  Does anyone already have a view
> > type defined that would allow me to display forms in such a tabular
> > fashion?  Or is there already some way to do this that I don't know
> > about?
>
> No, unfortunately not.
>
> > Otherwise, is the easiest way to do this just to create my own
> > new view type that displays the form as I want it?
>
> If I had a wish then it would be dataform support for custom renderers
> so we can easily choose which one we need and specialize them.
>
> I.e.:
>
> (defclass dataform ()
>   ((renderer :type (or symbol class) :initform *dataform-default-
> renderer*)
>    [...]))
>
> (defclass dataform-table-renderer (dataform-renderer)
>   ())
>
> (defmethod dataform-renderer-render-form ((form dataform-table-
> renderer))
>   ...)
>
> (make-instance 'dataform :renderer 'dataform-table-renderer)
>
> -- you get the idea.
>
> This shouldn't be hard to implement and will benefit us greatly in the
> long term.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to