Packages
form
4.11.1
11.4.15
11.4.14
8.3.0
8.0.0
7.10.0
7.8.0
7.7.0
7.6.2
7.6.1
7.6.0
7.4.2
7.4.1
7.4.0
7.1.0
6.11.1
6.10.7
6.10.6
6.10.5
6.10.4
6.10.2
6.10.1
6.4.0
5.12.1
5.12.0
5.8.7
5.8.6
5.8.5
5.8.4
5.8.3
5.8.2
5.8.1
5.8.0
5.7.0
5.5.0
5.3.4
5.3.3
5.3.2
5.3.1
5.3.0
5.1.10
5.1.9
5.1.8
5.1.7
5.1.6
5.1.5
5.1.4
5.1.3
5.1.2
5.1.1
4.12.3
4.12.2
4.12.1
4.12.0
4.11.15
4.11.14
4.11.13
4.11.12
4.11.11
4.11.10
4.11.9
4.11.8
4.11.7
4.11.6
4.11.5
4.11.4
4.11.3
4.11.2
4.11.1
4.11.0
4.10.5
4.10.4
4.10.3
4.10.2
4.10.1
4.10.0
4.7.0
4.6.0
ERP/1 X-FORM Business Cartulary
Current section
Files
Jump to
Current section
Files
man/form.htm
<html><head><meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="Maxim Sokhatsky" />
<title>FORM</title>
<link rel="stylesheet" href="https://n2o.dev/blank.css" />
<link rel="stylesheet" href="https://n2o.dev/zima.css" />
</head><body><nav>
<a href="https://n2o.dev">DEV</a>
<a href="https://form.n2o.dev">FORM</a>
<a href="#" style="background:#ededed;">API</a>
<div class="dropdown">
<a onclick="drop()" class="dropbtn">EN</a>
<div id="dropdown" class="dropdown-content">
<a href="https://n2o.dev/deps/form/man/ua/forms.htm">UA</a>
<a href="#">EN</a>
</div>
</div>
</nav><header>
<a href="../index.html"><img src="https://n2o.dev/img/Synrc Neo.svg" /></a>
<h1>FORM</h1>
</header>
<main>
<article>
<section>
<h3>INTRO</h3>
<p>The forms module provides AST transform of FORM document model
into NITRO element model (second layer) which later will be
transformed into HTML5 encoding (first layer).</p>
</section>
<section>
<h3>CALLBACK API</h3>
<p>The FORMS module expects forms to expose the following API.</p>
<h4>Module:id() -> tuple().</h4>
<p>Should return the default business object instance for this document form.</p>
<figure><code> id() -> #'Document'{}.</code></figure>
<h4>Module:new(Name :: string(),
BusinessObject :: tuple(),
Options :: list({ atom(), term() })) -> element().</h4>
<p>Should return the document form model by a given business object.</p>
<p>The standard set of options, provided with form base library:</p>
<div>
<ul><li><b>{edit,true}</b> — form for editing purposes.</li>
<li><b>{new,true}</b> — form for document creation purposes.</li>
<li><b>{view,true}</b> — form for document read only view mode.</li>
<li><b>{search,true}</b> — form for document search purposes with disabled validators.</li>
<li><b>{row,true}</b> — form for document row representation inside a table view.</li>
</ul>
</div>
<figure><code> new(Name,Object,Options) ->
#'div'{id=Name,body=io_lib:format("~tp",[Object,Options])}.</code></figure>
<h4>Module:doc() -> binary() | list().</h4>
<p>Retrieves the documentation string about this form module.</p>
<figure><code> doc() -> "simple".</code></figure>
</section>
<section>
<h3>STATIC API</h3>
<h4>new(Form :: #document{}, BusinessObject :: tuple()) -> binary() | list().</h4>
<p>Renders the form fullfilled with values from a given business object.</p>
<figure><code> > :form.new(:form_ok.new("name",otp(),[]),otp())
{:panel, :element, 'ok_name', [], [], [], [], [],
:form, [], [], [], [], [], [], [], [], [], [], [],
[{:panel, :element, [], [], [], [], [], [],
:caption, [], [], [], [], [], [], [], [], [], [], [],
[{:h4, :element, [], [], [], [], ...}], [], ...},
{:panel, :element, [], [], [], [], [], [],
:buttons, [], [], [], [], [], [], ...}], ...}</code></figure>
<figure><code> > :erlang.iolist_to_binary(
:nitro.render(
:form.new(
:form_ok.new("name",otp(),[]),otp())))
"<div id=\"ok_name\" class=\"form\"><div class=\"caption\"><h4>
Success Operation: CODE</h4></div><div class=\"buttons\"><a
class=\"button sgreen\" id=\"auto-422845\"
href=\"javascript:void(0);\">Confirm</a></div></div>"
</code></figure>
<br/>
<br/>
<br/>
</section>
<section>
<p>This module may refer to: MAN_MODULES</p>
</section>
</article>
</main>
<footer>2005—2019 © Synrc Research Center</footer>
<script>function drop(){document.getElementById("dropdown").classList.toggle("show");}</script>
</body></html>