Switch to a view-only schema

Advice on how to switch a ui-schema to “view-only” en masse.

e.g. we have a stepper wizard that uses multiple schemas, one for each step.

At the end we want to review the input, with a section per form, but in display-mode (not edit).

Can think of a couple of ways:

  1. switch the renderers set at runtime
  2. modify the uischema at runtime
  3. create a view-only uischemas

I guess adding a property-based solution to jsonforms would be nice akin to readonly; then we can use rankers out the bag

What do you think?

Hi @alastair-todd,

We offer a readonly prop on the JSON Forms component by which all renderers are instructed to render “view only”. Additionally you can set the validationMode to 'NoValidation' to save on performance.

In case you like some special rendering, for example by rendering only text instead of inputs then you need to implement an own read only renderer set.

1 Like