Interface UIFormWriter
- All Superinterfaces:
UIBodyWriter
,UIComponentWriter
,UIDependencyRegisterer
,UIJavaScriptWriter
,UIResourceLocator
,UISessionContext
- All Known Subinterfaces:
UIFormPaneWriter
,UserServicePaneWriter
,WidgetWriter
,WidgetWriterForList
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
.
- Since:
- 5.7.1, 5.3.0 for methods originally part of
UIFormPaneWriter
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.addJS_getNodeValue
(Path aPath) Adds JavaScript code to get the current value of a node, as set in the form.addJS_hideTab
(String tabId) Hides theUIFormPaneWithTabs.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.addJS_setNodeValue
(String aVarName, Path aPath) Adds JavaScript code to set the value of a node from a JavaScript variable.addJS_showTab
(String tabId) Shows theUIFormPaneWithTabs.Tab
having the specified identifier.void
Adds the label of the node at the given path.void
Adds the default widget, adapted to the data type and the facets of the specified node.void
Adds the specified widget.getDisplayMode
(Path aPath) Returns the display mode used in the model driven form.getPrefixedPath
(Path aPath) Gets the prefixed path for the specified path, taking into account the potential currentObjectKey
.newBestMatching
(Path aPath) Returns a new widget that will be automatically selected according to the corresponding node definition in the data model.newCheckBox
(Path aPath) Returns a new check box widget.newCheckBoxGroup
(Path aPath) Returns a new check box group widget.newColorPicker
(Path aPath) Returns a new color picker.newComboBox
(Path aPath) Returns a new combo box.<T extends UIWidget>
TnewCustomWidget
(Path aPath, UIWidgetFactory<T> aFactory) Returns a new instance of a widget which will be created by the given factory.newDatasetSelector
(Path aPath) Returns a new dataset selector.newDataspaceSelector
(Path aPath) Returns a dataspace selector.newDateTime
(Path aPath) Returns a date/time field.newDropDownList
(Path aPath) Returns a new drop-down list.newFormGroup
(Path aPath) Builds the default model-driven form group based on the specified node.newFormRow
(Path aPath) Builds the default model-driven form row based on the specified node.newListBox
(Path aPath) Returns a new list box.newPassword
(Path aPath) Returns a password field.newRadioButton
(Path aPath) Returns a new radio button widget.newRadioButtonGroup
(Path aPath) Returns a new radio button group widget.Returns a table widgetnewTextBox
(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.Methods inherited from interface com.orchestranetworks.ui.UIBodyWriter
add, add, add, add_cr, add_cr, addSafeAttribute, addSafeAttribute, addSafeInnerHTML, addSafeInnerHTML
Methods inherited from interface com.orchestranetworks.ui.UIComponentWriter
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
Methods inherited from interface com.orchestranetworks.ui.UIDependencyRegisterer
addJavaScriptDependency
Methods inherited from interface com.orchestranetworks.ui.UIJavaScriptWriter
addJS, addJS_addResizeWorkspaceListener, addJS_cr, addJS_cr, addJS_openPreviewImage, addJS_openPreviewImageFromVar, addJS_setButtonDisabled, addJS_setExpandCollapseBlockExpanded, addJS_setStateToToggleButton, addJS_switchToPerspective, addJS_switchToPerspectiveAction
Methods inherited from interface com.orchestranetworks.ui.UIResourceLocator
createWebComponentForRootSession, createWebComponentForSubSession, getURLForAjaxComponent, getURLForAjaxComponent, getURLForPerspectiveSelection, getURLForPerspectiveSelection, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForRest, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForViewSelection
Methods inherited from interface com.orchestranetworks.ui.UISessionContext
getLocale, getSession
-
Method Details
-
newCustomWidget
Returns a new instance of a widget which will be created by the given factory.- Since:
- 5.8.0
-
newBestMatching
Returns a new widget that will be automatically selected according to the corresponding node definition in the data model.- Parameters:
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.- See Also:
-
newTextBox
Returns a text input field, which can be one-line or multi-line.- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a node of a simple type.- See Also:
-
newTable
Returns a table widget- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a node that is a association.- See Also:
-
newDateTime
Returns a date/time field.- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a node of a simple type.- See Also:
-
newColorPicker
Returns a new color picker.- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a node of a simple type.- See Also:
-
newDataspaceSelector
Returns a dataspace selector.- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a node of a simple type.- Since:
- 5.8.1
- See Also:
-
newDatasetSelector
Returns a new dataset selector.- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a node of a simple type.- Since:
- 5.8.1
- See Also:
-
newComboBox
Returns a new combo box.- Parameters:
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.- See Also:
-
newCheckBox
Returns a new check box widget.- Parameters:
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.- Since:
- 5.4.1
- See Also:
-
newCheckBoxGroup
Returns a new check box group widget.- Parameters:
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.- See Also:
-
newDropDownList
Returns a new drop-down list.- Parameters:
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.- See Also:
-
newListBox
Returns a new list box.- Parameters:
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.- See Also:
-
newPassword
Returns a password field.- Parameters:
aPath
- location of the target node, relative to the record root node; it must refer to a simple type node.- Since:
- 5.7.0
- See Also:
-
newRadioButton
Returns a new radio button widget.- Parameters:
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.- See Also:
-
newRadioButtonGroup
Returns a new radio button group widget.- Parameters:
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.- See Also:
-
addWidget
Adds the default widget, adapted to the data type and the facets of the specified node.If the node is hidden for the user, this method does nothing.
This method is equivalent to:
aUIFormWriter.addWidget(aUIFormWriter.newBestMatching(aPath));
- Parameters:
aPath
- location of the node, relative to the record root node.- Throws:
UnsupportedOperationException
- if the specified path refers to a node that is neither terminal nor under-terminal.PathAccessException
- if the specified path is incorrect.- See Also:
-
addWidget
Adds the specified widget.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).- Parameters:
aWidget
- the widget to be added to this pane.- Throws:
UnsupportedOperationException
- if the specified widget refers to a node that is neither terminal nor under-terminal.PathAccessException
- if the specified path is incorrect.- See Also:
-
addFormRow
Adds a form row in the pane for the node at the given path.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()
andUIComponentWriter.endTableFormRow()
to have an automatic width for labels and benefit from the latest rendering innovations.- Parameters:
aPath
- location of the target node, relative to the record root node.- Throws:
UnsupportedOperationException
- if the specified path refers to a node that is neither terminal nor under-terminal.PathAccessException
- if the specified path is incorrect.
-
addFormRow
Adds a form row in the pane with the specified widget.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()
andUIComponentWriter.endTableFormRow()
to have an automatic width for labels and benefit from the latest rendering innovations.- Parameters:
aWidget
- the widget to be added to this pane.- Throws:
UnsupportedOperationException
- if the specified widget refers to a node that is neither terminal nor under-terminal.PathAccessException
- if the specified path is incorrect.
-
newFormRow
Builds the default model-driven form row based on the specified node. Here, "default model-driven" means the icon, label and documentation pane are computed from the data model definition.- Parameters:
aPath
- location of the target node, relative to the record root node.- See Also:
-
addFormRow
Adds a complete form row in the pane. The specified form row must be built withnewFormRow(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()
andUIComponentWriter.endTableFormRow()
to have an automatic width for labels and benefit from the latest rendering innovations.- Parameters:
aFormRow
- the form row, this object should be built by means of the methodnewFormRow(Path)
.- Throws:
IllegalArgumentException
- if the specified form row has not been built withnewFormRow(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.
-
addFormRow
Adds a complete form row in the pane according to the given specification with the specified user interface widget.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()
andUIComponentWriter.endTableFormRow()
to have an automatic width for labels and benefit from the latest rendering innovations.- Parameters:
aFormRow
- the form row specification with thePath
of the target nodeaWidget
- the widget to be added to this pane.- Throws:
UnsupportedOperationException
- if the specified widget refers to a node that is neither terminal nor under-terminal.PathAccessException
- if the specified path is incorrect.
-
startFormRow
Starts a row in the form for the node at the given path.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()
andUIComponentWriter.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.
- Parameters:
aPath
- location of the target node, relative to the record root node.- Throws:
PathAccessException
- if the specified path is incorrect.- See Also:
-
addFormGroup
Adds a group which represents the given path children.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()
andUIComponentWriter.endTableFormRow()
.Child nodes which should be displayed in an external tab are ignored.
- Parameters:
aFormGroup
- a form group leading to a complex node- Throws:
PathAccessException
- if the specified path included in theUIFormGroup
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.- Since:
- 5.8.0
- See Also:
-
addFormRowOrGroup
Adds rows to the form to represent the given path. This method is a shorthand for usingaddFormRow(Path)
andaddFormGroup(UIFormGroup)
. The call function should be betweenUIComponentWriter.startTableFormRow()
andUIComponentWriter.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.
- Parameters:
aPath
- path of the targeted node, should be valid- Throws:
PathAccessException
- 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.- Since:
- 5.8.0
- See Also:
-
newFormGroup
Builds the default model-driven form group based on the specified node. Here, "default model-driven" means the label, the documentation pane and the initial state of the group (expanded or collapsed) are computed from the data model definition.- Parameters:
aPath
- location of the target node, relative to the record root node.- Since:
- 5.7.0
- See Also:
-
startFormGroup
Starts a form group for the node at the given path.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()
andUIComponentWriter.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.
- Parameters:
aPath
- location of the target node, relative to the record root node.- Throws:
PathAccessException
- if the specified path is incorrect.IllegalStateException
- ifUIComponentWriter.startTableFormRow()
was not called before.- Since:
- 5.7.0
- See Also:
-
addLabel
Adds the label of the node at the given path.- Parameters:
aPath
- location of the target node, relative to the record root node.
-
startBorder
Starts a border with a title caption. This is equivalent to an HTML<fieldset>
with a<legend>
.Note: The border must be terminated with UIComponentWriter.endBorder().
- Parameters:
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)- Throws:
PathAccessException
- if the specified path is incorrect.- See Also:
-
addJS_getNodeValue
Adds JavaScript code to get the current value of a node, as set in the form.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.
- Parameters:
aPath
- location of the target node, relative to the record root node.- Since:
- 5.3.1
-
addJS_setNodeValue
Adds JavaScript code to set the value of a node from a JavaScript variable.Mapping to JavaScript types
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.
Action on "after value changed"
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.
- Parameters:
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.- Since:
- 5.3.1
- See Also:
-
addJS_setNodeMandatoryIndicator
Adds or removes a mandatory indicator (*) next to the label of the specified node to simulate that it is mandatory. It does not add or remove neither constraints nor validation rules applied to the node.- Parameters:
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.- Since:
- 6.0.0
- See Also:
-
getPrefixedPath
Gets the prefixed path for the specified path, taking into account the potential currentObjectKey
.This method is useful for instance when using JavaScript methods
JavaScriptCatalog.ebx_form_getValue(String)
andJavaScriptCatalog.ebx_form_setValue(String, Object)
.- Since:
- 5.8.0
- See Also:
-
addJS_hideTab
Hides theUIFormPaneWithTabs.Tab
having the specified identifier.- Since:
- 5.7.0
- See Also:
-
addJS_showTab
Shows theUIFormPaneWithTabs.Tab
having the specified identifier.- Since:
- 5.7.0
- See Also:
-
getDisplayMode
Returns the display mode used in the model driven form.If the underlying node is a table, will return
UIForm.DisplayMode.NONE
.- Parameters:
aPath
- the path, must be relative.- Throws:
PathAccessException
- if the specified path is incorrect.- Since:
- 5.8.0
-