solid-ui icon indicating copy to clipboard operation
solid-ui copied to clipboard

Handling multiple form definitions (ui:annotationForm)

Open josephguillaume opened this issue 3 years ago • 2 comments

It is possible for a single class to be assigned multiple forms with ui:creationForm or ui:annotationForm

A permanent solution probably requires either a mechanism to give the user a choice, to hardcode an order of preference (e.g. based on the document ui:annotationForm is defined in) or allow a user to specify a priority level for the form.

For my immediate purposes I have the problem that the same ui:annotationForm statement can be specified in multiple documents, which results in the form being rendered multiple times.

The logic to return the form to be used is in: https://github.com/solid/solid-ui/blob/766c3f7906f991c582baad50f29061c1c9836a55/src/widgets/forms.js#L992

My temporary solution is to remove duplicate forms (i.e. ignore which document the ui:annotationForm statement was defined in). The two lines of code are here: https://github.com/josephguillaume/my-solidos-patches/blob/afad1a9cc443fc1c996eec5dcc9463f55c670a1f/solid-ui.diff#L46

josephguillaume avatar Feb 01 '22 22:02 josephguillaume

Sorry I cannot really help you but do you know this talk on forms from @timbl https://solid.github.io/solid-ui/Documentation/talks/FormsTalk.html#(1)

bourgeoa avatar Feb 02 '22 09:02 bourgeoa

No worries. This seems to be mostly a UX decision that needs to be taken at some point. If others run into this problem then hopefully they'll find this issue and we can continue the discussion here...

josephguillaume avatar Feb 02 '22 20:02 josephguillaume