HTMLFormEntry is a very effective way of saving forms. You create the XML and the module handles transforming the input into database records upon pressing submit.
How can we render a form, e.g. at path/to/form.xml?
Do we have to render it in its own page or can we load it into a page?
1. Create a new form object from your xml
Option 1: Utilizing
public void HtmlFormEntry.HtmlForm.setXmlData(String xmlData)Option 2: if your XML is not loaded yet, utilizing
public static HtmlForm HtmlFormEntryUI.HtmlFormUtil.getHtmlFormFromUiResource(<arguments>), referencerelativeWebResourcePathis the relative path from the directory/omod/src/main/webapp/resourcesof your module.ResourceFactory resourceFactory, FormService formService, HtmlFormEntryService htmlFormEntryService, String providerAndPath2. Use FormEntrySession to generate HTML and handle form entry, submission, etc
3. Use the html generated
The html that the
FormEntrySessionobject generated should contain all the logic required to submit the form.