Html page rendering through schema

Does JsonForms support rendering html page through schema and uischema?

Hi @Annushamss,

Can you elaborate what you mean? If you use custom renderers you can support whatever you like, so in theory you could generate a HTML page instead of rendering a UI.

Hi @sdirix, thanks for your response!

I’m using React Material UI and pass json schema and uischema from a database to JsonForms. The html page must be included from the schema, that is, it changes depending on the requirement and the expectation is JsonForms should render the schema provided that has html page linked.

The html page would be a part of other elements on the screen.

I’m new to json schema and wanted to know how do we handle the rendering of the html page as described above. Is it through schema alone? Or does JsonFroms provide any way of handling incoming html page and render it along with other incoming elements?

Thank you!

Sounds to me that what you want is to hand over the JSON Schema dynamically? This is of course possible, in the end it’s just Javascript and JSON Forms does not care about where the schema / UI schema comes from.

Thanks for your response @sdirix !

Yes that was a part of my question. I also wanted to know that if I want to render a whole html page as a part of the JsonForms how do I go about it? How does the JsonForms expect the html page be configured as? in schema? or does it handle it differently? if through schema then how do we write schema for this? or should we need any custom rendering?

In the below image content inside of red box is from json shema and inside green box is html page. I need to find a way to send the html page to Jsonforms and render it as a part of the other elements through schema or any other way. But it should be input to JsonForms itself.

How do I achieve it? Please help.
Thanks in advance!

Hi @Annushamss,

With a custom renderer anything is possible. So feel free to attach arbitrary HTML to your schema or UI schema and render it with React.

Note that I recommend to only render form related UI with JSON Forms. A major advantage of JSON Forms is its flexibility with the rendering system. It’s so flexible that some developers (mis)use it as a renderer system for their whole application. However for anything not form-related there is no benefit of rendering it within JSON Forms, on the contrary it usually complicates things and then often leads to a massive increase of scope for the schema and UI Schema.

1 Like

Thanks for your response @sdirix.