How do I create new / custom HTML tags for htmlforms within a module?
<customTag id="unique_id" />
Is there any tutorial or guide which I can follow?
How do I create new / custom HTML tags for htmlforms within a module?
<customTag id="unique_id" />
Is there any tutorial or guide which I can follow?
I don’t think there’s any tutorial-style documentation of this.
One example is the codedOrFreeTextObs tag in the coreapps module. See these files: https://github.com/openmrs/openmrs-module-coreapps/search?utf8=✓&q=CodedOrFreeTextObsTagHandler
FYI,
This is supposed to include a static HTML in the form. The static page has a button and a canvas which is included in the custom module.
If that helps.
I suggest you look at the link I shared. It will tell you how to register a TagHandler in your module’s activator.
You also need to implement a generateHtml()
method in Java.
If you’re working within the Reference Application context, and using the uiframework module, you can include your static html as is shown here: https://github.com/openmrs/openmrs-module-coreapps/blob/1.11.1/api/src/main/java/org/openmrs/module/coreapps/htmlformentry/EncounterDiagnosesElement.java#L125