Opened 17 years ago
Closed 17 years ago
#36 closed enhancement (fixed)
Modify renderers to allow specialization on slot types
Reported by: | Slava Akhmechet | Owned by: | Slava Akhmechet |
---|---|---|---|
Priority: | medium | Milestone: | 0.1 |
Component: | weblocks | Version: | pre-0.1 |
Keywords: | renderers slots types dropdown custom | Cc: |
Description
Currently specializing renderers to output various types in a custom manner (dropdowns for lists, checkboxes for booleans, etc.) is broken because when slots are set to nil, type information is lost.
We need to modify renderers to accept one more argument 'slot-type', and modify 'visit-object-slots' to pass this argument to renderers.
We also need to add common sense default specializations. Booleans should output checkboxes in forms and true/false in data renderers (instead of N/A which is done for nils now). Lists (sequences?) should render as dropdowns (or local suggest snippets) in forms. We also need to add some type aliases. For example 'one-of' types should render as radio buttons.
How will we render sequences in data renderers? Some options include rendering each item in a comma separated list, having a link to datagrid, etc.
Change History (5)
comment:1 Changed 17 years ago by
Priority: | high → medium |
---|
comment:2 Changed 17 years ago by
comment:3 Changed 17 years ago by
Once we've added slot-type (and obj) to render-form/data/etc, we should add :maxlength attribute to 'render-form' obtained via 'max-raw-slot-input-length'.
comment:4 Changed 17 years ago by
We also need to apply typespec inspection mechanism to parse-slot-from-request, slot-in-request-empty-p, and object-satisfies-search-p. We should probably grep for slot-type to be sure.
comment:5 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed by adding slot-type argument to relevant generic functions. Additionally, these generic functions have been modified to to have 'slot-management-generic-function' metaclass. This metaclass customizes generic function invocation in a way that properly pre-processes arguments to allow inheritance customization.
We have to think of a unified solution for humanize-typespec, invalid-input-error-message, and render-[form/data/table] as far as dealing with subclasses. If we simply pass symbols sniffed from deftype, all inheritance information will be lost. We should try find-class on those symbols first and use classes if possible.