Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Resolve question of how best to encode form's structure #14

Closed
waldoj opened this issue Dec 29, 2016 · 3 comments
Closed

Resolve question of how best to encode form's structure #14

waldoj opened this issue Dec 29, 2016 · 3 comments

Comments

@waldoj
Copy link
Contributor

waldoj commented Dec 29, 2016

Per the discussion in #9, there's a fundamental conflict that I'm not sure of how to best resolve, and that's about how to represent the form structure and style it properly. JSON Form has a notable limitation: form JSON cannot be nested (at least, not much). This makes it challenging to break the form up into its constituent sections while also providing decent granularity for each of the fields in that section. We have three choices:

  1. Represent each form section in form.json as "type": "fieldset" groups. That eliminates any JSON Form display options (e.g., rendering select fields as radio buttons), and necessitates using CSS to group together fields...if that's possible.
  2. Do not include form sections in form.json, but instead represent each field, one by one, serially. Use a combination of CSS and form.json options (e.g., prepend, htmlClass) to group fields together. Challenge: including descriptive text / titles before or after form groupings.
  3. See if using a different JSON Schema library, e.g. Alpaca, will make it possible to nest form elements. Switching wouldn't be particularly difficult at this point, since JSON Schema is JSON Schema.
@waldoj
Copy link
Contributor Author

waldoj commented Dec 29, 2016

There is a help data type, that allows arbitrary HTML to be injected between fields, but it's nested within two divs and a span. Useful, but not great.

@waldoj
Copy link
Contributor Author

waldoj commented Dec 29, 2016

JSON Form is extensible, and the example new field injects arbitrary HTML between fields. So, that sounds good.

@waldoj
Copy link
Contributor Author

waldoj commented Dec 29, 2016

After an hour of testing, I feel good about option #2. It's working well. This is the correct solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant