Class QuickGridView

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Box
org.zkoss.zul.Vbox
org.adempiere.webui.adwindow.QuickGridView
All Implemented Interfaces:
Serializable, Cloneable, EventListener, IFieldEditorContainer, StateChangeListener, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.IdSpace, org.zkoss.zk.ui.sys.ComponentCtrl

public class QuickGridView extends org.zkoss.zul.Vbox implements org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, org.zkoss.zk.ui.IdSpace, IFieldEditorContainer, StateChangeListener
Quick Grid view implemented using the Grid component (Base on GridView).
Since:
Nov 03, 2017
Author:
Logilite Technologies
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl

    Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

    org.zkoss.zk.ui.AbstractComponent.Children
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    shortcut key for cell navigation
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final int
     
    protected boolean
    true if there are AD_Tab_Customization for GridTab
    boolean
    true if no new row or new row have been saved
    protected org.zkforge.keylistener.Keylistener
    reference to desktop key listener
    Zk List model for tableModel
    static final int
     
    org.zkoss.zul.Paging
     
    IQuickForm that own this QuickGridView instance
    static final int
     
    protected Checkbox
    checkbox to select all row of current page

    Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    _zclass

    Fields inherited from interface org.zkoss.zk.ui.Component

    APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE

    Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

    AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuickGridView(int windowNo)
     
    QuickGridView(AbstractADWindowContent abstractADWindowContent, GridTab gridTab, IQuickForm wQuickForm)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    remove all components
    protected void
    create data grid instances
    void
    add new row to data grid
    boolean
    dataSave(int code)
    Save changes
    void
    dynamicDisplay(int col)
    Validate display properties of fields of current row
    protected void
    echo ON_POST_SELECTED_ROW_CHANGED_EVENT after current row index has changed
    void
    editorTraverse(Callback<WEditor> editorTaverseCallback)
    Call editorTaverseCallback for all editors hosted by this container
    org.zkoss.zul.Column
     
    void
    set focus to first field editor
    void
    set focus to next field editor from ref
    list field display in grid mode, in case user customize grid this list container only customize list.
    list field display in grid mode, in case user customize grid this list container only customize list.
     
     
    void
    init(GridTab gridTab)
    Init data grid
    boolean
     
    boolean
     
    boolean
     
    protected void
    not used. candidate for removal.
    void
    onEvent(org.zkoss.zk.ui.event.Event event)
     
    void
    onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)
     
    void
    onPageDetached(org.zkoss.zk.ui.Page page)
     
    void
    Event after the current row index has changed.
    void
    refresh(GridTab gridTab)
    Refresh data grid (int of quick form or column setup has change)
    void
    Re-Init QuickGridView with cache gridTab.
    void
    scroll grid to the current focus row
    void
    Set AD window content part that own this QuickGridView instance
    void
    setGridField(GridField[] gridField)
     
    void
    setPageSize(int pageSize)
    set paging size
    void
    setStatusLine(String text, boolean error)
    set status text
    void
    setWindowNo(int windowNo)
     
    void
    State change event
    void
    turn on/off select all rows for current page
    void
    Update current row index from model
    boolean
    updateModelIndex(int rowIndex)
    Update gridTab current row index.

    Methods inherited from class org.zkoss.zul.Box

    evalCSSFlex, getAlign, getHeights, getOrient, getPack, getSpacing, getWidths, getZclass, isHorizontal, isSizedByContent, isVertical, renderProperties, setAlign, setHeights, setOrient, setPack, setSizedByContent, setSpacing, setWidths

    Methods inherited from class org.zkoss.zul.impl.XulElement

    clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes

    Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    addSclass, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly

    Methods inherited from class org.zkoss.zk.ui.AbstractComponent

    addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

    invalidatePartial

    Methods inherited from interface org.zkoss.zk.ui.IdSpace

    getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellow

    Methods inherited from interface org.adempiere.webui.adwindow.IFieldEditorContainer

    editorTraverse

    Methods inherited from interface org.zkoss.zk.ui.ext.Scope

    addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
  • Field Details

    • SALES_ORDER_LINE_TAB_ID

      public static final int SALES_ORDER_LINE_TAB_ID
      See Also:
    • CNTRL_KEYS

      public static final String CNTRL_KEYS
      shortcut key for cell navigation
      See Also:
    • EVENT_ON_SELECT_ROW

      public static final String EVENT_ON_SELECT_ROW
      See Also:
    • EVENT_ON_CUSTOMIZE_GRID

      public static final String EVENT_ON_CUSTOMIZE_GRID
      See Also:
    • EVENT_ON_PAGE_NAVIGATE

      public static final String EVENT_ON_PAGE_NAVIGATE
      See Also:
    • EVENT_ON_CLICK_TO_NAVIGATE

      public static final String EVENT_ON_CLICK_TO_NAVIGATE
      See Also:
    • EVENT_ON_SET_FOCUS_TO_FIRST_CELL

      public static final String EVENT_ON_SET_FOCUS_TO_FIRST_CELL
      See Also:
    • EVENT_ON_AFTER_SAVE

      public static final String EVENT_ON_AFTER_SAVE
      See Also:
    • EVENT_ONFOCUS_AFTER_SAVE

      public static final String EVENT_ONFOCUS_AFTER_SAVE
      See Also:
    • FOCUS_CODE

      public static final int FOCUS_CODE
      See Also:
    • listModel

      public GridTableListModel listModel
      Zk List model for tableModel
    • paging

      public org.zkoss.zul.Paging paging
    • selectAll

      protected Checkbox selectAll
      checkbox to select all row of current page
    • isHasCustomizeData

      protected boolean isHasCustomizeData
      true if there are AD_Tab_Customization for GridTab
    • keyListener

      protected org.zkforge.keylistener.Keylistener keyListener
      reference to desktop key listener
    • isNewLineSaved

      public boolean isNewLineSaved
      true if no new row or new row have been saved
    • quickForm

      public IQuickForm quickForm
      IQuickForm that own this QuickGridView instance
  • Constructor Details

    • QuickGridView

      public QuickGridView(int windowNo)
      Parameters:
      windowNo -
    • QuickGridView

      public QuickGridView(AbstractADWindowContent abstractADWindowContent, GridTab gridTab, IQuickForm wQuickForm)
      Parameters:
      abstractADWindowContent -
      gridTab -
      wQuickForm -
  • Method Details

    • getGridField

      public GridField[] getGridField()
      list field display in grid mode, in case user customize grid this list container only customize list.
      Returns:
      GridField[]
    • setGridField

      public void setGridField(GridField[] gridField)
      Parameters:
      gridField -
    • getRenderer

      public QuickGridTabRowRenderer getRenderer()
      Returns:
      QuickGridTabRowRenderer
    • createListbox

      protected void createListbox()
      create data grid instances
    • init

      public void init(GridTab gridTab)
      Init data grid
      Parameters:
      gridTab -
    • isInit

      public boolean isInit()
      Returns:
      true if data grid have been init with GridTab
    • refresh

      public void refresh(GridTab gridTab)
      Refresh data grid (int of quick form or column setup has change)
      Parameters:
      gridTab -
    • isRefreshing

      public boolean isRefreshing()
      Returns:
      true if data grid is refreshing data from GridTab
    • updateListIndex

      public void updateListIndex()
      Update current row index from model
    • echoOnPostSelectedRowChanged

      protected void echoOnPostSelectedRowChanged()
      echo ON_POST_SELECTED_ROW_CHANGED_EVENT after current row index has changed
    • setPageSize

      public void setPageSize(int pageSize)
      set paging size
      Parameters:
      pageSize -
    • clear

      public void clear()
      remove all components
    • onEvent

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

      public boolean isAllSelected()
      Returns:
      true if all row of current page is selected
    • toggleSelectionForAll

      public void toggleSelectionForAll(boolean b)
      turn on/off select all rows for current page
      Parameters:
      b -
    • onPostSelectedRowChanged

      public void onPostSelectedRowChanged()
      Event after the current row index has changed.
    • scrollToCurrentRow

      public void scrollToCurrentRow()
      scroll grid to the current focus row
    • updateModelIndex

      public boolean updateModelIndex(int rowIndex)
      Update gridTab current row index.
      Parameters:
      rowIndex - row index of current page
      Returns:
      true if gridTab current row index has change
    • getListbox

      public Grid getListbox()
      Returns:
      Grid
    • dynamicDisplay

      public void dynamicDisplay(int col)
      Validate display properties of fields of current row
      Parameters:
      col -
    • setWindowNo

      public void setWindowNo(int windowNo)
      Parameters:
      windowNo -
    • setADWindowPanel

      public void setADWindowPanel(AbstractADWindowContent winPanel)
      Set AD window content part that own this QuickGridView instance
      Parameters:
      winPanel -
    • reInit

      public void reInit()
      Re-Init QuickGridView with cache gridTab.
    • getFields

      public GridField[] getFields()
      list field display in grid mode, in case user customize grid this list container only customize list.
      Returns:
      GridField[]
    • focusToFirstEditor

      public void focusToFirstEditor()
      Description copied from interface: IFieldEditorContainer
      set focus to first field editor
      Specified by:
      focusToFirstEditor in interface IFieldEditorContainer
    • focusToNextEditor

      public void focusToNextEditor(WEditor ref)
      Description copied from interface: IFieldEditorContainer
      set focus to next field editor from ref
      Specified by:
      focusToNextEditor in interface IFieldEditorContainer
    • stateChange

      public void stateChange(StateChangeEvent event)
      Description copied from interface: StateChangeListener
      State change event
      Specified by:
      stateChange in interface StateChangeListener
    • onADTabPanelParentChanged

      protected void onADTabPanelParentChanged()
      not used. candidate for removal.
    • setStatusLine

      public void setStatusLine(String text, boolean error)
      set status text
      Parameters:
      text -
      error -
    • createNewLine

      public void createNewLine()
      add new row to data grid
    • dataSave

      public boolean dataSave(int code)
      Save changes
      Parameters:
      code - cell navigation code
    • onPageAttached

      public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)
      Specified by:
      onPageAttached in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      onPageAttached in class org.zkoss.zk.ui.AbstractComponent
    • onPageDetached

      public void onPageDetached(org.zkoss.zk.ui.Page page)
      Specified by:
      onPageDetached in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      onPageDetached in class org.zkoss.zk.ui.AbstractComponent
    • editorTraverse

      public void editorTraverse(Callback<WEditor> editorTaverseCallback)
      Description copied from interface: IFieldEditorContainer
      Call editorTaverseCallback for all editors hosted by this container
      Specified by:
      editorTraverse in interface IFieldEditorContainer
    • findCurrentSortColumn

      public org.zkoss.zul.Column findCurrentSortColumn()
      Returns:
      sort column (if any)