10

I am trying to get a custom component working in Formio.js. I would love a complete, nontrivial working example.

I am not using angular, ng, react or the form.io service.

The documentation is terrible. I can copy out the Checkmatrix example code and run it (after much fiddling) but even it doesn't work correctly: in the formbuilder, the edit and delete controls don't show up. (There an bug issue open on this, but no resolution, which is distinctly worrisome.)

There are dead links all over the SDK reference documentation.. like for example for "Component" which seems particularly important.

There is no documentation of any of code used by the example. For example, it uses the 'renderTemplate' call, but the arguments are not described anywhere.

It appears that the only way to understand any part of this system to try to figure out all of the source code. There are no instructions for adding code.

It's not even clear what the best way to proceed is: whether I should fork the formio.js repo, learn TypeScript, and add components directly (creating a hassle if I ever want to keep formio.js up to date) or continue trying to work by registering components from add-on scripts in the browser.

** Can anyone give concrete advice on the best way to go? **

Nathaniel Tagg
  • 385
  • 2
  • 14
  • 1
    I didn't know this library, but I just had a look, and they indeed have a problem with their Github pages deployment. But if you clone the project locally and open the `docs/index.html` file in your browser, you'll have access to the entire documentation. Even for `renderTemplate`. But I hope you have a good Internet connection, it's more than 500 MB. Sorry for not helping that much, but I hope that's a step forward :) – blex Jan 25 '20 at 23:25
  • 1
    Thanks @blex, but the documentation basically just names the arguments, and doesn't actually provide any, you know, documentation.... – Nathaniel Tagg Jan 27 '20 at 20:48
  • 1
    I'm curious if you ever found a good example. I'm looking now, and having the same trouble. Their 6-year-old examples repo has outdated code that doesn't work for formio in its current version. – Tap Mar 25 '21 at 18:41
  • No, but I did manage to create my own in various flavors. I can provide a skeleton example if you like. What kind of custom element are you thinkijg of? – Nathaniel Tagg Mar 27 '21 at 01:53
  • 1
    Any working example would make a good answer to your own question - and the community would (obviously) benefit from that. I'm currently trying to simply derive from the built-in components to create custom versions that I can configure the editor for independently of the out-of-the-box components. Do you have an example of e.g. extending the `textfield` component? – Oliver Jul 22 '21 at 16:09
  • I found a documentation here that might be helpful to you. As I work out of the CDN link, I struggle to apply the "module pattern" and I haven't been able to do it using this setup. But you might have the ability to compile your js, in which case it should be helpful to you: https://docs.form.io/developers/custom-components#extending-components – daneczech Aug 04 '21 at 08:42
  • Struggling with the same thing, any resources you can share that aided in getting this running? – Thomas Aug 29 '22 at 14:57

1 Answers1

0

@nathaniel Tagg I couldn't find form.io proper form examples, so i would like to see your form.io examples if you are like to provide. Here is my email 'udara@staff.medicalwizard.com.au'

Udara
  • 11
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 02 '22 at 08:50
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31193459) – Sebastian Simon Mar 09 '22 at 05:45