Class WRecordEditor<T>

java.lang.Object
org.adempiere.webui.editor.WEditor
org.adempiere.webui.editor.WRecordEditor<T>
All Implemented Interfaces:
PropertyChangeListener, EventListener, IInputValidator, IZoomableEditor, ContextMenuListener, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
Direct Known Subclasses:
WRecordIDEditor, WRecordUUIDEditor

public abstract class WRecordEditor<T> extends WEditor implements ContextMenuListener, IZoomableEditor
Default editor for DisplayType.RecordID and DisplayType.RecordUU.
Implemented with composite component of Textbox and ToolBarButton.
The editor uses WRecordIDDialog for edit or viewing.
Author:
Peter Takacs, Cloudempiere
  • Field Details

    • recordIDValue

      protected Object recordIDValue
      Record_ID or Record_UU value
    • tableIDValue

      protected Object tableIDValue
      AD_Table_ID value
    • tableIDGridField

      protected GridField tableIDGridField
      Current tab's AD_Table_ID GridField
    • recordTextBox

      protected Textbox recordTextBox
    • editButton

      protected ToolBarButton editButton
    • zoomButton

      protected ToolBarButton zoomButton
  • Constructor Details

    • WRecordEditor

      public WRecordEditor(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration)
      Constructor
      Parameters:
      gridField -
      tableEditor -
      editorConfiguration -
  • Method Details

    • init

      protected void init()
      Init component and context menu
    • onMenu

      public void onMenu(ContextMenuEvent evt)
      Specified by:
      onMenu in interface ContextMenuListener
    • setReadWrite

      public void setReadWrite(boolean readWrite)
      Specified by:
      setReadWrite in class WEditor
    • isReadWrite

      public boolean isReadWrite()
      Specified by:
      isReadWrite in class WEditor
      Returns:
      true if editable
    • setValue

      public void setValue(Object value)
      Description copied from class: WEditor
      Set editor value
      Specified by:
      setValue in class WEditor
    • setValue

      protected void setValue(Object value, boolean fire)
      Set Value
      Parameters:
      value - new value
      fire - true to fire value change event
    • getValue

      public Object getValue()
      Specified by:
      getValue in class WEditor
      Returns:
      Object, current value of editor
    • getDisplay

      public String getDisplay()
      Specified by:
      getDisplay in class WEditor
      Returns:
      display text
    • getDisplayTextForGridView

      public String getDisplayTextForGridView(GridRowCtx gridRowCtx, Object value)
      Overrides:
      getDisplayTextForGridView in class WEditor
      Parameters:
      gridRowCtx - GridRowCtx
      Returns:
      display text for grid view, for consumption by WEditor.getDisplayComponent()
    • onEvent

      public void onEvent(org.zkoss.zk.ui.event.Event event) throws Exception
      Specified by:
      onEvent in interface org.zkoss.zk.ui.event.EventListener<T>
      Throws:
      Exception
    • getAD_Table_ID

      public Object getAD_Table_ID()
      Get AD_Table_ID
      Returns:
      AD_Table_ID value
    • setAD_Table_ID

      public void setAD_Table_ID(Object tableID)
      Set AD_Table_ID
      Parameters:
      tableID -
    • getComponent

      public org.zkoss.zul.Div getComponent()
      Overrides:
      getComponent in class WEditor
      Returns:
      Component
    • isUseUUIDKey

      public abstract boolean isUseUUIDKey()
      Use UUID as key column
      Returns:
      Key column name
    • toKeyValue

      public abstract T toKeyValue(Object value)
      Convert value to key value type
      Parameters:
      value -
      Returns:
      key value
    • validateTableIdValue

      public abstract String validateTableIdValue(int tableId)
      Validate selected table id value
      Parameters:
      tableId -
      Returns:
      error message or null