Package com.orchestranetworks.ui.form.widget

# Class UICustomWidget

java.lang.Object
com.orchestranetworks.ui.form.widget.UICustomWidget

All Implemented Interfaces:
  `UIWidget`

Direct Known Subclasses:
  `UIListCustomWidget`, `UISimpleCustomWidget`

public abstract class UICustomWidget extends Object implements UIWidget
Base class for custom widgets. A custom widget can display an element differently and/or modify its value.

This abstract class cannot be extended directly: a custom widget must extend either `UISimpleCustomWidget` or `UIListCustomWidget`. In addition, a factory must be provided.

Since:
  5.8.0
See Also:
  - `UIWidgetFactory`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isDisplayingCustomWidgetValidationMessage(WidgetDisplayContext widgetDisplayContext)`
  This method allows to activate or deactivate the display of validation messages that are associated with the data element bound to this custom widget.
  `final boolean`
  `isEditorDisabled()`
  `final void`
  `setEditorDisabled(boolean disabled)`
  Forces the widget to be in read-only mode if the specified argument is `true`.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### setEditorDisabled

    public final void setEditorDisabled(boolean disabled)
    Description copied from interface: `UIWidget`
    Forces the widget to be in read-only mode if the specified argument is `true`. If the widget is hidden due to permissions, this method has no effect.

    By default, the widget will display its editable version only if the user is allowed to edit the node.

    Default value is `false`.

    Specified by:
      `setEditorDisabled` in interface `UIWidget`
    Parameters:
      `disabled` - `true` to force the widget to display its read-only version, `false` to let the system display the editor that corresponds to the current widget.

  - ### isEditorDisabled

    public final boolean isEditorDisabled()
    Specified by:
      `isEditorDisabled` in interface `UIWidget`
    Returns:
      `true` if the widget is forced to display its read-only version, `false` otherwise.
    See Also:
      - `UIWidget.setEditorDisabled(boolean)`

  - ### isDisplayingCustomWidgetValidationMessage

    public boolean isDisplayingCustomWidgetValidationMessage(WidgetDisplayContext widgetDisplayContext)
    This method allows to activate or deactivate the display of validation messages that are associated with the data element bound to this custom widget. Validation messages are:
    - always automatically displayed for each built-in widget added to this custom widget;
    - automatically displayed at the level of the custom widget itself, only if this method returns `true`.

    This method can be overridden; the default implementation returns:

    - `false` if the custom widget is bound to a field (in order to avoid the message being displayed twice, in case a built-in widget is added inside);
    - `true` otherwise.
    See Also:
      - `JavaScriptCatalog.ebx_form_setNodeMessage(String, com.orchestranetworks.ui.JavaScriptCatalog.EBX_ValidationMessage)`