Package net.pricefx.formulaengine.forms


package net.pricefx.formulaengine.forms
The Forms 2.0 API for building dynamic forms from a Form logic.

A Form logic runs in three phases. Each phase exposes its own interface through the form binding.

  • FormInitApi declares the initial set of inputs and the layout, in the Init phase.
  • FormValueOptionsApi supplies the values of OPTION and OPTIONS inputs on demand, in the ValueOptions phase.
  • FormActionApi reacts to user actions such as value changes and clicks, in the Action phase.

FormInputBuilderApi carries the create... factory methods shared across the phases. These methods reuse the builder classes of the net.pricefx.formulaengine.scripting.inputbuilder package, with the terminal call buildFormInput().

Layout is arranged with FormLayout, obtained with form.layout() in the Init phase. Attach a node to the layout with addChild.

  • FormLayoutNode is the common interface of the layout nodes.
  • FormRow arranges inputs horizontally. Create it with layout.createRow(name).
  • FormContainer groups inputs with an optional heading and collapsible behavior. Create it with layout.createContainer(name).
  • FormModal shows inputs in a popup dialog with an optional heading. Create it with layout.createModal(name).

FormChange collects the property changes to apply to an input, such as value, label, read only state and validation messages. The Action phase obtains one with form.updateInput(name) or form.insertAfter(name, inputs).

Forms 2.0 is available since version 17.0. It replaces the "input generation" mode and configurators as the current mechanism for all new implementations.

See Also: