public interface UIFormWriter extends UIComponentWriter
This interface offers methods useful to create standard EBX® forms.
Before EBX® 5.7.1, most methods of this class were part of class UIFormPaneWriter
.
UIFormPaneWriter
Modifier and Type | Method and Description |
---|---|
void |
addFormGroup(UIFormGroup aFormGroup)
Adds a group which represents the given path children.
|
void |
addFormRow(Path aPath)
Adds a form row in the pane for the node at the given path.
|
void |
addFormRow(UIFormRow aFormRow)
Adds a complete form row in the pane.
|
void |
addFormRow(UIFormRow aFormRow,
UIWidget aWidget)
Adds a complete form row in the pane according to the given specification
with the specified user interface widget.
|
void |
addFormRow(UIWidget aWidget)
Adds a form row in the pane with the specified widget.
|
void |
addFormRowOrGroup(Path aPath)
Adds rows to the form to represent the given path.
|
UIJavaScriptWriter |
addJS_getNodeValue(Path aPath)
Adds JavaScript code to get the current value of a node, as set in the form.
|
UIJavaScriptWriter |
addJS_hideTab(String tabId)
Hides the
UIFormPaneWithTabs.Tab having the specified identifier. |
void |
addJS_setNodeMandatoryIndicator(boolean isDisplayed,
Path aPath)
Adds or removes a mandatory indicator (*) next to the label of the specified node to
simulate that it is mandatory.
|
UIJavaScriptWriter |
addJS_setNodeValue(String aVarName,
Path aPath)
Adds JavaScript code to set the value of a node from a JavaScript variable.
|
UIJavaScriptWriter |
addJS_showTab(String tabId)
Shows the
UIFormPaneWithTabs.Tab having the specified identifier. |
void |
addLabel(Path aPath)
Adds the label of the node at the given path.
|
void |
addWidget(Path aPath)
Adds the default widget, adapted to the data type
and the facets of the specified node.
|
void |
addWidget(UIWidget aWidget)
Adds the specified widget.
|
UIFormNode.DisplayMode |
getDisplayMode(Path aPath)
Returns the display mode used in the model driven form.
|
Path |
getPrefixedPath(Path aPath)
Gets the prefixed path for the specified path, taking into account the potential
current
ObjectKey . |
UIWidget |
newBestMatching(Path aPath)
Returns a new widget that will be automatically selected according
to the corresponding node definition in the data model.
|
UICheckBox |
newCheckBox(Path aPath)
Returns a new check box widget.
|
UICheckBoxGroup |
newCheckBoxGroup(Path aPath)
Returns a new check box group widget.
|
UIColorPicker |
newColorPicker(Path aPath)
Returns a new color picker.
|
UIComboBox |
newComboBox(Path aPath)
Returns a new combo box.
|
<T extends UIWidget> |
newCustomWidget(Path aPath,
UIWidgetFactory<T> aFactory)
Returns a new instance of a widget which will be created by the given factory.
|
UIDatasetSelector |
newDatasetSelector(Path aPath)
Returns a new dataset selector.
|
UIDataspaceSelector |
newDataspaceSelector(Path aPath)
Returns a dataspace selector.
|
UIDateTime |
newDateTime(Path aPath)
Returns a date/time field.
|
UIDropDownList |
newDropDownList(Path aPath)
Returns a new drop-down list.
|
UIFormGroup |
newFormGroup(Path aPath)
Builds the default model-driven form group based on the specified node.
|
UIFormRow |
newFormRow(Path aPath)
Builds the default model-driven form row based on the specified node.
|
UIListBox |
newListBox(Path aPath)
Returns a new list box.
|
UIPassword |
newPassword(Path aPath)
Returns a password field.
|
UIRadioButton |
newRadioButton(Path aPath)
Returns a new radio button widget.
|
UIRadioButtonGroup |
newRadioButtonGroup(Path aPath)
Returns a new radio button group widget.
|
UITable |
newTable(Path aPath)
Returns a table widget
|
UITextBox |
newTextBox(Path aPath)
Returns a text input field, which can be one-line or multi-line.
|
void |
startBorder(boolean isColored,
Path aPath)
Starts a border with a title caption.
|
void |
startFormGroup(Path aPath)
Starts a form group for the node at the given path.
|
void |
startFormRow(Path aPath)
Starts a row in the form for the node at the given path.
|
addButtonHelp, addButtonJavaScript, addButtonJavaScriptToggle, addUILabel, addUserAvatar, buildButtonPreview, buildButtonPreview, buildButtonPreview, endBorder, endExpandCollapseBlock, endFormGroup, endFormRow, endTableFormRow, newExpandCollapseBlock, newFormGroup, newFormRow, startBorder, startBorder, startBorder, startExpandCollapseBlock, startExpandCollapseBlock, startFormGroup, startFormGroup, startFormRow, startFormRow, startFormRow, startFormRow, startTableFormRow
add_cr, add_cr, add, add, add, addSafeAttribute, addSafeAttribute, addSafeInnerHTML, addSafeInnerHTML
addJS_addResizeWorkspaceListener, addJS_cr, addJS_cr, addJS_openPreviewImage, addJS_openPreviewImageFromVar, addJS_setButtonDisabled, addJS_setExpandCollapseBlockExpanded, addJS_setStateToToggleButton, addJS_switchToPerspective, addJS_switchToPerspectiveAction, addJS
createWebComponentForRootSession, createWebComponentForSubSession, getURLForAjaxComponent, getURLForAjaxComponent, getURLForPerspectiveSelection, getURLForPerspectiveSelection, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForRest, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForViewSelection
addJavaScriptDependency
getLocale, getSession
<T extends UIWidget> T newCustomWidget(Path aPath, UIWidgetFactory<T> aFactory)
UIWidget newBestMatching(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node that is either
terminal
or under-terminal.addWidget(UIWidget)
UITextBox newTextBox(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type.addWidget(UIWidget)
UITable newTable(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node that is a
association.addWidget(UIWidget)
UIDateTime newDateTime(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type.addWidget(UIWidget)
UIColorPicker newColorPicker(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type.addWidget(UIWidget)
UIDataspaceSelector newDataspaceSelector(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type.addWidget(UIWidget)
UIDatasetSelector newDatasetSelector(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type.addWidget(UIWidget)
UIComboBox newComboBox(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type and
depending on an enumeration.addWidget(UIWidget)
UICheckBox newCheckBox(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a boolean or an aggregated list of a simple
type and
depending on an enumeration.addWidget(UIWidget)
UICheckBoxGroup newCheckBoxGroup(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to an aggregated list of a simple type and
depending on an enumeration.addWidget(UIWidget)
UIDropDownList newDropDownList(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type and
depending on an enumeration.addWidget(UIWidget)
UIListBox newListBox(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type and
depending on an enumeration.addWidget(UIWidget)
UIPassword newPassword(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a simple type node.addWidget(UIWidget)
UIRadioButton newRadioButton(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type and
depending on an enumeration.addWidget(UIWidget)
UIRadioButtonGroup newRadioButtonGroup(Path aPath)
aPath
- location of the target node, relative to the record root node;
it must refer to a node of a simple type and
depending on an enumeration.addWidget(UIWidget)
void addWidget(Path aPath)
If the node is hidden for the user, this method does nothing.
This method is equivalent to:
aUIFormWriter.addWidget(aUIFormWriter.newBestMatching(aPath));
aPath
- location of the node, relative to the record root node.UnsupportedOperationException
- if the specified path refers to a node that is neither
terminal
nor under-terminal.PathAccessException
- if the specified path is incorrect.newBestMatching(Path)
void addWidget(UIWidget aWidget)
If the underlying node is hidden according to the
permission rules,
then this method does nothing.
If the field is read-only according to the permission rules, then a read-only component is displayed.
This method does not take into account the defaultView
property
(since its application is restricted to the default view, which is not the case here).
aWidget
- the widget to be added to this pane.UnsupportedOperationException
- if the specified widget refers to a node that is neither
terminal
nor under-terminal.PathAccessException
- if the specified path is incorrect.addFormRow(UIWidget)
,
addFormRow(UIFormRow, UIWidget)
void addFormRow(Path aPath)
A form row is composed of an icon, a label and the user interface widget corresponding to the specified field or group, either in read-only or in read-write mode.
The row is adapted to the data type and the facets of the node.
If the field is hidden according to the
permission rules,
then this method does nothing.
If the field is read-only according to the permission rules, then a read-only component is displayed.
This method does not take into account the defaultView
property
(since its application is restricted to the default view, which is not the case here).
This method is equivalent to:
aUIFormWriter.addFormRow(aUIFormWriter.newFormRow(aPath));
It is strongly recommended to surround form rows with
UIComponentWriter.startTableFormRow()
and
UIComponentWriter.endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
aPath
- location of the target node, relative to the record root node.UnsupportedOperationException
- if the specified path refers to a node that is neither
terminal
nor under-terminal.PathAccessException
- if the specified path is incorrect.void addFormRow(UIWidget aWidget)
A form row is composed of an icon, a label and the user interface widget corresponding to the specified field or group, either in read-only or in read-write mode.
If the field is hidden according to the
permission rules,
then this method does nothing.
If the field is read-only according to the permission rules, then a read-only component is displayed.
This method does not take into account the defaultView
property
(since its application is restricted to the default view, which is not the case here).
It is strongly recommended to surround form rows with
UIComponentWriter.startTableFormRow()
and
UIComponentWriter.endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
aWidget
- the widget to be added to this pane.UnsupportedOperationException
- if the specified widget refers to a node that is neither
terminal
nor under-terminal.PathAccessException
- if the specified path is incorrect.UIFormRow newFormRow(Path aPath)
aPath
- location of the target node, relative to the record root node.UIComponentWriter.newFormRow()
void addFormRow(UIFormRow aFormRow)
newFormRow(Path)
, the user input zone
will be adapted to the data type and the facets of the underlying node.
If the underlying node is hidden according to the
permission rules,
then this method does nothing.
If the field is read-only according to the permission rules, then a read-only component is displayed.
This method does not take into account the defaultView
property
(since its application is restricted to the default view, which is not the case here).
It is strongly recommended to surround form rows with
UIComponentWriter.startTableFormRow()
and
UIComponentWriter.endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
aFormRow
- the form row, this object should be built by means of the method newFormRow(Path)
.IllegalArgumentException
- if the specified form row has not been built with
newFormRow(Path)
.UnsupportedOperationException
- if the specified row's path refers to a node that is neither
terminal
nor under-terminal.PathAccessException
- if the specified path is incorrect.void addFormRow(UIFormRow aFormRow, UIWidget aWidget)
A form row is composed of an icon, a label and the user interface widget corresponding to the specified field or group, either in read-only or read-write mode.
If the field is hidden according to the
permission rules,
then this method does nothing.
If the field is read-only according to the permission rules, then a read-only component is displayed.
This method does not take into account the defaultView
property
(since its application is restricted to the default view, which is not the case here).
This method is equivalent to:
aUIFormWriter.startFormRow(aFormRow); aUIFormWriter.addWidget(aWidget); aUIFormWriter.endFormRow();
It is strongly recommended to surround form rows with
UIComponentWriter.startTableFormRow()
and
UIComponentWriter.endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
aFormRow
- the form row specification with the Path
of the target nodeaWidget
- the widget to be added to this pane.UnsupportedOperationException
- if the specified widget refers to a node that is neither
terminal
nor under-terminal.PathAccessException
- if the specified path is incorrect.void startFormRow(Path aPath)
This method displays the default icon and label of the specified node; the user input zone has to be added independently.
This method is equivalent to:
aUIFormWriter.startFormRow(aUIFormWriter.newFormRow(aPath));
It is strongly recommended to surround form rows with
UIComponentWriter.startTableFormRow()
and
UIComponentWriter.endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form row must be ended with UIComponentWriter.endFormRow() after creating its HTML content.
aPath
- location of the target node, relative to the record root node.PathAccessException
- if the specified path is incorrect.UIComponentWriter.startFormRow(UIFormRow)
void addFormGroup(UIFormGroup aFormGroup)
If the underlying node is hidden according to the
permission rules,
then this method does nothing.
If the field is read-only according to the permission rules, then a read-only component is displayed.
This method does not take into account the defaultView
property for the root path
(since its application is restricted to the default view, which is not the case here).
The call function should be between a UIComponentWriter.startTableFormRow()
and UIComponentWriter.endTableFormRow()
.
Child nodes which should be displayed in an external tab are ignored.
aFormGroup
- a form group leading to a complex nodePathAccessException
- if the specified path included in the UIFormGroup
is incorrect;
for instance, it does not refer to an existing node,
or it is absolute and specifies a record node,
or specifies a terminal value descendant.addFormRow(Path)
,
getDisplayMode(Path)
void addFormRowOrGroup(Path aPath)
addFormRow(Path)
and addFormGroup(UIFormGroup)
.
The call function should be between UIComponentWriter.startTableFormRow()
and UIComponentWriter.endTableFormRow()
.
If the path is equal to the root path, it will only add children of the associated SchemaNode
.
Child nodes which should be displayed in an external tab are ignored.
aPath
- path of the targeted node, should be validPathAccessException
- if the specified path is incorrect;
for instance, it does not refer to an existing node,
or it is absolute and specifies a record node,
or specifies a terminal value descendant.getDisplayMode(Path)
UIFormGroup newFormGroup(Path aPath)
aPath
- location of the target node, relative to the record root node.UIComponentWriter.newFormGroup(UIFormLabelSpec)
,
UIComponentWriter.startFormGroup(UIFormGroup)
void startFormGroup(Path aPath)
This method displays the default model-driven form group based on the specified node. Here, "default model-driven" means that the label, the documentation pane and the initial state of the group (expanded or collapsed) are computed from the data model definition.
This method is equivalent to:
aUIFormWriter.startFormGroup(aUIFormWriter.newFormGroup(aPath));
It is mandatory to surround a form group with
UIComponentWriter.startTableFormRow()
and
UIComponentWriter.endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form group must be ended with UIComponentWriter.endFormGroup() to stop the indentation.
aPath
- location of the target node, relative to the record root node.PathAccessException
- if the specified path is incorrect.IllegalStateException
- if UIComponentWriter.startTableFormRow()
was not called before.UIComponentWriter.startFormGroup(UIFormGroup)
,
UIComponentWriter.startFormGroup(UIFormLabelSpec)
void addLabel(Path aPath)
aPath
- location of the target node, relative to the record root node.void startBorder(boolean isColored, Path aPath)
<fieldset>
with a <legend>
.
Note: The border must be terminated with UIComponentWriter.endBorder().
isColored
- true
to have a border color,
false
to have a gray border.aPath
- required, location of the target, relative to the record root node (for better reusability, it
is advised to use a relative path)PathAccessException
- if the specified path is incorrect.UIComponentWriter.endBorder()
UIJavaScriptWriter addJS_getNodeValue(Path aPath)
Note: If the node is read-only, the JavaScript type is automatic
(the UIWidget
set for this node is not applied).
Known limitation: If the node can be inherited, the value is the overwritten value in the input field.
aPath
- location of the target node, relative to the record root node.UIJavaScriptWriter addJS_setNodeValue(String aVarName, Path aPath)
The mapping to a JavaScript type depends on the widget that is associated with the specified path. For more information, see 'JavaScript type' in the JavaDoc of each widget.
If an afterValueChanged action is defined on the widget, it will trigger if the value is valid (for example, setting 'true' for a date widget is not valid).
Known limitation: If the node can be inherited, the value is the overwritten value in the input field.
aVarName
- the name of a JavaScript variable containing the value, or the raw value.aPath
- location of the target node, relative to the record root node.UIWidget
,
UIAtomicWidget.setActionOnAfterValueChanged(com.orchestranetworks.ui.base.JsFunctionCall)
void addJS_setNodeMandatoryIndicator(boolean isDisplayed, Path aPath)
isDisplayed
- true
to add a mandatory indicator,
false
to remove a mandatory indicator.aPath
- location of the target node, relative to the record root node.JavaScriptCatalog.ebx_form_setMandatoryIndicator(java.lang.String, boolean)
Path getPrefixedPath(Path aPath)
ObjectKey
.
This method is useful for instance when using JavaScript methods
JavaScriptCatalog.ebx_form_getValue(String)
and
JavaScriptCatalog.ebx_form_setValue(String, Object)
.
UserServicePaneWriter.getCurrentObjectKey()
UIJavaScriptWriter addJS_hideTab(String tabId)
UIFormPaneWithTabs.Tab
having the specified identifier.UIFormPaneWithTabs.Tab.setId(String)
,
UIFormPaneWithTabs.Tab.setInitiallyHidden()
UIJavaScriptWriter addJS_showTab(String tabId)
UIFormPaneWithTabs.Tab
having the specified identifier.UIFormPaneWithTabs.Tab.setId(String)
,
UIFormPaneWithTabs.Tab.setInitiallyHidden()
UIFormNode.DisplayMode getDisplayMode(Path aPath)
If the underlying node is a table, will return UIForm.DisplayMode.NONE
.
aPath
- the path, must be relative.PathAccessException
- if the specified path is incorrect.