Class WSearchEditor

java.lang.Object
org.adempiere.webui.editor.WEditor
org.adempiere.webui.editor.WSearchEditor
All Implemented Interfaces:
PropertyChangeListener, EventListener, IInputValidator, IZoomableEditor, ContextMenuListener, ValueChangeListener, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>

public class WSearchEditor extends WEditor implements ContextMenuListener, ValueChangeListener, IZoomableEditor
Default editor for DisplayType.Search and DisplayType.SearchUU.
Implemented with WSearchEditor.CustomSearchBox component and InfoPanel, InfoWindow dialog.
Author:
Ashley G Ramdass
  • Field Details

    • ATTRIBUTE_IS_INFO_PANEL_OPEN

      public static final String ATTRIBUTE_IS_INFO_PANEL_OPEN
      Boolean component attribute to store whether info panel is open
      See Also:
    • lookup

      protected Lookup lookup
    • infoPanel

      protected InfoPanel infoPanel
    • adwindow

      protected ADWindow adwindow
      ADWindow instance that own this editor
    • multipleSelection

      protected boolean multipleSelection
  • Constructor Details

    • WSearchEditor

      public WSearchEditor(GridField gridField)
      Parameters:
      gridField -
    • WSearchEditor

      public WSearchEditor(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration)
      Parameters:
      gridField -
      tableEditor -
      editorConfiguration -
    • WSearchEditor

      public WSearchEditor(Lookup lookup, String label, String description, boolean mandatory, boolean readonly, boolean updateable)
      Constructor for use if a grid field is unavailable
      Parameters:
      lookup - Store of selectable data
      label - field label
      description - description of component
      mandatory - whether field is mandatory
      readonly - whether or not the editor is read only
      updateable - whether the editor contents can be changed
    • WSearchEditor

      public WSearchEditor(String columnName, boolean mandatory, boolean readonly, boolean updateable, Lookup lookup)
      Parameters:
      columnName -
      mandatory -
      readonly -
      updateable -
      lookup -
  • Method Details

    • getComponent

      public ComboEditorBox getComponent()
      Overrides:
      getComponent in class WEditor
      Returns:
      Component
    • isReadWrite

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

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

      public void enableAutoComplete()
      Turn on auto complete for editor
    • disableAutoComplete

      public void disableAutoComplete()
      Turn off auto complete for editor
    • setValue

      public void setValue(Object value)
      Description copied from class: WEditor
      Set editor value
      Specified by:
      setValue in class WEditor
    • 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
    • onEvent

      public void onEvent(org.zkoss.zk.ui.event.Event e)
      Specified by:
      onEvent in interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
    • actionRefresh

      protected void actionRefresh(Object value)
      Refresh editor value
      Parameters:
      value -
    • actionZoom

      public void actionZoom()
      Zoom to window for reference/target table
      Specified by:
      actionZoom in interface IZoomableEditor
    • onMenu

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

      protected void actionText(String text)
      Process text input from user
      Parameters:
      text -
    • actionDrill

      protected void actionDrill()
      Open drill assistant dialog
    • resetButtonState

      protected void resetButtonState()
      Reset state of WSearchEditor.CustomSearchBox button to default
    • actionCombo

      protected void actionCombo(Object value)
      Process value from InfoPanel/InfoWindow.
      Fire ValueChangeEvent.
      Parameters:
      value -
    • actionQuickEntry

      protected void actionQuickEntry(boolean newRecord)
      Action - Special Quick Entry Screen
      Parameters:
      newRecord - true if new record should be created
    • actionButton

      protected void actionButton(String queryValue)
      Handle onClick event from WSearchEditor.CustomSearchBox button.
      Parameters:
      queryValue -
    • showInfoPanel

      public void showInfoPanel(InfoPanel ip)
      Open InfoPanel/InfoWindow dialog
      Parameters:
      ip - InfoPanel
    • getEvents

      public String[] getEvents()
      Overrides:
      getEvents in class WEditor
      Returns:
      list of WEditor.component events that this editor will listen to
    • valueChange

      public void valueChange(ValueChangeEvent evt)
      Specified by:
      valueChange in interface ValueChangeListener
    • setTableEditor

      public void setTableEditor(boolean b)
      Description copied from class: WEditor
      Set grid view mode. Have no effect if editor doesn't has a separate grid view mode.
      Overrides:
      setTableEditor in class WEditor
    • isShowingDialog

      public boolean isShowingDialog()
      Returns:
      true if InfoPanel/InfoWindow dialog is active
    • createBPartner

      public static WSearchEditor createBPartner(int windowNo)
      Create new WSearhEditor instance for C_Invoice.C_BPartner_ID column.
      Parameters:
      windowNo -
      Returns:
      WSearchEditor
    • createProduct

      public static WSearchEditor createProduct(int windowNo)
      Create new WSearchEditor instance for C_InvoiceLine.M_Product_ID column.
      Parameters:
      windowNo -
      Returns:
      WSearchEditor
    • dynamicDisplay

      public void dynamicDisplay(Properties ctx)
      Description copied from class: WEditor
      Dynamic update of component state
      Overrides:
      dynamicDisplay in class WEditor
    • getDisplayTextForGridView

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

      public boolean isMultipleSelection()
      Returns:
      true if info window allow multiple selection
    • setMultipleSelection

      public void setMultipleSelection(boolean multipleSelection)
      Parameters:
      multipleSelection -