Is is possible to use JSONForms from a static web page?


I am working on a project which requires a feasible form demonstration. The UI runs both in qt web engine and a static web server, so it is impossible to make use of the NodeJs server. I think there should be a way to integrate JSONForms using “raw” js call, like referring a set of js & css files in the and call a builder function after is loaded, much like the usage of of the jsonform library.

However, I cannot find any document about such usage. I think a simple HTML file showing a simple form would help a lot. Would anyone please provide such a tutorial? Thanks very much!

Hi @metorm, at the moment we don’t offer an out-of-the-box or builder pattern to simply create a form. However you can create one yourself if you’d like to.

You can go the direct route and for example programmatically use React to create a JsonForms component with the appropriate props. This makes the most sense when you are also using React for other purposes than rendering JSON Forms.

A different approach would be to bundle JSON Forms core with a binding, renderer set of choice and all its dependencies to a web component. Here is an example for the JSON Forms Angular Material. Then you have one clear entry point to render a form and only one (large) JS dependency.