How can we get a HTML component from a Magritte
description?
We want to do a "general search". A type (DocumentItem) can be
selected, then the available descriptions are shown. Now if a
description is selected, we need an input field corresponding to
the type of the description to specifiy the search criteria.
(checkbox for boolean description, ...). We tried attribute
asComponent, attribute class defaultComponentClass, but neither
worked.
I don't properly understand what you are trying to do. What is
'attribute'?
We can not use asComponentOn: as we don't have a
specific object
to edit.
Magritte requires a model to store the date when you want to show a
dialog built from a description.
Probably the easiest thing you can do is to instantiate the selected
DocumentItem and display a dialog on this one.
Other possibilities might be:
- you could use a scaffolder that contains a dictionary with
associations of the form: description -> value. This is a technique
that is commonly used for user defined forms. Take care, MAScaffolder
in Magritte is currently not working, you should probably create your
own class.
- you could write a Memento (older versions of Magritte called it
Wrapper) that doesn't require a model.
HTH,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch