Class ADTabpanel

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Div
org.adempiere.webui.adwindow.ADTabpanel
All Implemented Interfaces:
Serializable, Cloneable, EventListener, IADTabpanel, IFieldEditorContainer, DataStatusListener, Evaluatee, 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 ADTabpanel extends org.zkoss.zul.Div implements Evaluatee, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, DataStatusListener, IADTabpanel, org.zkoss.zk.ui.IdSpace, IFieldEditorContainer
UI for an AD_Tab content (AD_Tab + AD_Fields).
Version:
$Revision: 0.10 $
Author:
Ashley G Ramdass, Low Heng Sin
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
    protected boolean
    true if tab have been activated
    protected List<Group>
    all collapsible groups
    static final String
    Event after execution of dynamicDisplay(int)
    static final String
    post init event for tab panel
    static final String
    event after tab panel had switch presentation between form and list view
    static final String
    event to toggle between form and list view

    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

    Fields inherited from interface org.adempiere.webui.adwindow.IADTabpanel

    ATTR_ON_ACTIVATE_POSTED, ON_ACTIVATE_EVENT
  • Constructor Summary

    Constructors
    Constructor
    Description
    default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(boolean activate)
    Activate/deactivate panel
    void
    activate selected detail tab if it is visible
    void
    afterSave(boolean onSaveEvent)
    Handle after save event
    void
    Create UI for AD_Fields
    protected void
    createUI(boolean update)
    Create UI for AD_Fields
    boolean
    dataSave(boolean onSaveEvent)
    Save changes.
    void
    Data Changed
    void
    dynamicDisplay(int col)
    Update state of fields (visibility, style, writable, etc)
    void
    editorTraverse(Callback<WEditor> editorTaverseCallback)
    Call editorTaverseCallback for all editors hosted by this container
    void
     
    protected void
    focusToEditor(WEditor toFocus, boolean checkCurrent)
     
    void
    set focus to first active editor
    void
    focusToFirstEditor(boolean checkCurrent)
    void
    set focus to next readwrite editor from ref
    get_ValueAsString(String variableName)
    Get Variable Value
     
     
     
     
     
    int
     
     
    int
     
    int
     
     
    List<org.zkoss.zul.Button>
    Get all visible toolbar button editors
     
     
    int
     
    boolean
     
    void
    init(AbstractADWindowContent winPanel, GridTab gridTab)
    init tab panel layout (formContainer and listeners
    boolean
     
    boolean
    Is panel need refresh
    boolean
     
    boolean
    Get is detail pane visible
    boolean
     
    boolean
     
    boolean
     
    protected boolean
     
    boolean
    needSave(boolean rowChange, boolean onlyRealChange)
    protected void
    handle client info event
    boolean
    Handle enter key event
    void
    onEvent(org.zkoss.zk.ui.event.Event event)
     
    void
    onPageDetached(org.zkoss.zk.ui.Page page)
     
    void
    Retrieve from db.
    void
    query(boolean onlyCurrentRows, int onlyCurrentDays, int maxRows)
    Retrieve from db
    void
    Refresh current row
    void
    Reset detail data grid for new parent record that's not saved yet.
    protected void
    savePreference(String attribute, String value)
    Save user preference for this AD Window
    void
    Set the DetailPane part that own this IADTabpanel instance
    void
    setDetailPaneMode(boolean detailPaneMode)
    Turn on/off detail mode, i.e either tab panel is currently a header or detail tab of the UI.
    void
    setFocusToField(String columnName)
     
    void
    setParent(org.zkoss.zk.ui.Component parent)
     
    void
    set selected tree node for current row (if there's tree)
    void
    setTabNo(int tabNo)
    Set tab number/sequence within an AD_Window
    void
    Toggle between form and grid view
    void
    updateDetailToolbar(org.zkoss.zul.Toolbar toolbar)
    Enabled/Disabled DetailPane toolbar buttons
    void
    Enabled/Disabled ADWindowToolbar buttons

    Methods inherited from class org.zkoss.zul.Div

    getAlign, renderProperties, setAlign

    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, evalCSSFlex, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, 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, onPageAttached, 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, 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.Component

    addEventListener, addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientDataAttribute, getDefinition, getDesktop, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getShadowVariable, getShadowVariable, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, query, queryAll, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setTemplate, setVisible, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride

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

    invalidatePartial

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

    isEnableProcessButton

    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

    • ON_POST_INIT_EVENT

      public static final String ON_POST_INIT_EVENT
      post init event for tab panel
      See Also:
    • ON_SWITCH_VIEW_EVENT

      public static final String ON_SWITCH_VIEW_EVENT
      event after tab panel had switch presentation between form and list view
      See Also:
    • ON_DYNAMIC_DISPLAY_EVENT

      public static final String ON_DYNAMIC_DISPLAY_EVENT
      Event after execution of dynamicDisplay(int)
      See Also:
    • allCollapsibleGroups

      protected List<Group> allCollapsibleGroups
      all collapsible groups
    • activated

      protected boolean activated
      true if tab have been activated
    • ON_TOGGLE_EVENT

      public static final String ON_TOGGLE_EVENT
      event to toggle between form and list view
      See Also:
  • Constructor Details

    • ADTabpanel

      public ADTabpanel()
      default constructor
  • Method Details

    • setDetailPane

      public void setDetailPane(DetailPane component)
      Description copied from interface: IADTabpanel
      Set the DetailPane part that own this IADTabpanel instance
      Specified by:
      setDetailPane in interface IADTabpanel
    • getDetailPane

      public DetailPane getDetailPane()
      Specified by:
      getDetailPane in interface IADTabpanel
      Returns:
      the DetailPane part that own this IADTabpanel instance
    • init

      public void init(AbstractADWindowContent winPanel, GridTab gridTab)
      init tab panel layout (formContainer and listeners
      Specified by:
      init in interface IADTabpanel
      Parameters:
      winPanel -
      gridTab -
    • createUI

      public void createUI()
      Create UI for AD_Fields
      Specified by:
      createUI in interface IADTabpanel
    • createUI

      protected void createUI(boolean update)
      Create UI for AD_Fields
      Parameters:
      update - true if it is update instead of create new
    • dynamicDisplay

      public void dynamicDisplay(int col)
      Update state of fields (visibility, style, writable, etc)
      Specified by:
      dynamicDisplay in interface IADTabpanel
      Parameters:
      col -
    • getDisplayLogic

      public String getDisplayLogic()
      Specified by:
      getDisplayLogic in interface IADTabpanel
      Returns:
      display logic
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface IADTabpanel
      Returns:
      title of tab
    • get_ValueAsString

      public String get_ValueAsString(String variableName)
      Description copied from interface: Evaluatee
      Get Variable Value
      Specified by:
      get_ValueAsString in interface Evaluatee
      Parameters:
      variableName -
      Returns:
      value
    • getTabLevel

      public int getTabLevel()
      Specified by:
      getTabLevel in interface IADTabpanel
      Returns:
      The tab level of this Tabpanel
    • getTableName

      public String getTableName()
      Specified by:
      getTableName in interface IADTabpanel
      Returns:
      The tablename of this Tabpanel
    • getRecord_ID

      public int getRecord_ID()
      Specified by:
      getRecord_ID in interface IADTabpanel
      Returns:
      The record ID of current row
    • isCurrent

      public boolean isCurrent()
      Is panel need refresh
      Specified by:
      isCurrent in interface IADTabpanel
      Returns:
      true if GridTab need refresh
    • getWindowNo

      public int getWindowNo()
      Returns:
      windowNo
    • query

      public void query()
      Retrieve from db. Delegate to GridTab.query(boolean)
      Specified by:
      query in interface IADTabpanel
    • query

      public void query(boolean onlyCurrentRows, int onlyCurrentDays, int maxRows)
      Retrieve from db
      Specified by:
      query in interface IADTabpanel
      Parameters:
      onlyCurrentRows - True to show only unprocessed or the one updated within x days (default is 1 day before today)
      onlyCurrentDays - if > 0, filter records with created >= current_date - onlyCurrentDays
      maxRows - if > 0, maximum number of rows to load
    • resetDetailForNewParentRecord

      public void resetDetailForNewParentRecord()
      Reset detail data grid for new parent record that's not saved yet. Delegate to GridTab.resetDetailForNewParentRecord().
      Specified by:
      resetDetailForNewParentRecord in interface IADTabpanel
    • getGridTab

      public GridTab getGridTab()
      Specified by:
      getGridTab in interface IADTabpanel
      Returns:
      GridTab
    • getTreePanel

      public ADTreePanel getTreePanel()
      Specified by:
      getTreePanel in interface IADTabpanel
      Returns:
      ADTreePanel
    • getTreeDisplayedOn

      public String getTreeDisplayedOn()
      Returns:
      master, detail or both
    • refresh

      public void refresh()
      Refresh current row
      Specified by:
      refresh in interface IADTabpanel
    • activate

      public void activate(boolean activate)
      Activate/deactivate panel
      Specified by:
      activate in interface IADTabpanel
      Parameters:
      activate -
    • focusToFirstEditor

      public void focusToFirstEditor()
      set focus to first active editor
      Specified by:
      focusToFirstEditor in interface IFieldEditorContainer
    • focusToFirstEditor

      public void focusToFirstEditor(boolean checkCurrent)
      Parameters:
      checkCurrent -
    • onEvent

      public void onEvent(org.zkoss.zk.ui.event.Event event)
      Specified by:
      onEvent in interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
      Parameters:
      event -
      See Also:
      • EventListener.onEvent(Event)
    • setSelectedNode

      public void setSelectedNode()
      set selected tree node for current row (if there's tree)
    • dataStatusChanged

      public void dataStatusChanged(DataStatusEvent e)
      Description copied from interface: DataStatusListener
      Data Changed
      Specified by:
      dataStatusChanged in interface DataStatusListener
      Parameters:
      e -
      See Also:
    • switchRowPresentation

      public void switchRowPresentation()
      Toggle between form and grid view
      Specified by:
      switchRowPresentation in interface IADTabpanel
    • afterSave

      public void afterSave(boolean onSaveEvent)
      Description copied from interface: IADTabpanel
      Handle after save event
      Specified by:
      afterSave in interface IADTabpanel
      See Also:
    • focus

      public void focus()
      Overrides:
      focus in class org.zkoss.zk.ui.HtmlBasedComponent
    • setFocusToField

      public void setFocusToField(String columnName)
      Parameters:
      columnName -
    • onEnterKey

      public boolean onEnterKey()
      Description copied from interface: IADTabpanel
      Handle enter key event
      Specified by:
      onEnterKey in interface IADTabpanel
      Returns:
      true if the event is process
      See Also:
    • isGridView

      public boolean isGridView()
      Specified by:
      isGridView in interface IADTabpanel
      Returns:
      true if list/grid view is visible
    • getGridView

      public GridView getGridView()
      Specified by:
      getGridView in interface IADTabpanel
      Returns:
      GridView
    • isActivated

      public boolean isActivated()
      Specified by:
      isActivated in interface IADTabpanel
      Returns:
      true if the tab panel have been activated
    • setDetailPaneMode

      public void setDetailPaneMode(boolean detailPaneMode)
      Description copied from interface: IADTabpanel
      Turn on/off detail mode, i.e either tab panel is currently a header or detail tab of the UI.
      Specified by:
      setDetailPaneMode in interface IADTabpanel
    • getToolbarButtons

      public List<org.zkoss.zul.Button> getToolbarButtons()
      Get all visible toolbar button editors
      Specified by:
      getToolbarButtons in interface IADTabpanel
      Returns:
      List
    • needSave

      public boolean needSave(boolean rowChange, boolean onlyRealChange)
      Description copied from interface: IADTabpanel
      Specified by:
      needSave in interface IADTabpanel
      Returns:
      true if there are pending changes
    • dataSave

      public boolean dataSave(boolean onSaveEvent)
      Description copied from interface: IADTabpanel
      Save changes. Call GridTab.dataSave(boolean)
      Specified by:
      dataSave in interface IADTabpanel
      Returns:
      true if the save operation completed successfully
    • isDetailPaneMode

      public boolean isDetailPaneMode()
      Specified by:
      isDetailPaneMode in interface IADTabpanel
      Returns:
      true if the panel is in detail mode (i.e a detail tab in DetailPane)
    • setTabNo

      public void setTabNo(int tabNo)
      Description copied from interface: IADTabpanel
      Set tab number/sequence within an AD_Window
      Specified by:
      setTabNo in interface IADTabpanel
    • getTabNo

      public int getTabNo()
      Specified by:
      getTabNo in interface IADTabpanel
      Returns:
      tab no ( ad_tab.tabno )
    • activateDetailIfVisible

      public void activateDetailIfVisible()
      activate selected detail tab if it is visible
    • isDetailVisible

      public boolean isDetailVisible()
      Description copied from interface: IADTabpanel
      Get is detail pane visible
      Specified by:
      isDetailVisible in interface IADTabpanel
      Returns:
      true if DetailPane is visible
    • hasDetailTabs

      public boolean hasDetailTabs()
      Returns:
      true if selected tab has one or more detail/child tab
    • focusToNextEditor

      public void focusToNextEditor(WEditor ref)
      set focus to next readwrite editor from ref
      Specified by:
      focusToNextEditor in interface IFieldEditorContainer
      Parameters:
      ref -
    • focusToEditor

      protected void focusToEditor(WEditor toFocus, boolean checkCurrent)
      Parameters:
      toFocus -
      checkCurrent - true to check if form currently has focus (using zk.currentFocus)
    • setParent

      public void setParent(org.zkoss.zk.ui.Component parent)
      Specified by:
      setParent in interface org.zkoss.zk.ui.Component
      Overrides:
      setParent 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
    • savePreference

      protected void savePreference(String attribute, String value)
      Save user preference for this AD Window
      Parameters:
      attribute -
      value -
    • onClientInfo

      protected void onClientInfo()
      handle client info event
    • isMobile

      protected boolean isMobile()
      Returns:
      true if client is mobile
    • 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
    • isEnableQuickFormButton

      public boolean isEnableQuickFormButton()
      Specified by:
      isEnableQuickFormButton in interface IADTabpanel
      Returns:
      true if Quick Form Button is Enabled
    • isEnableCustomizeButton

      public boolean isEnableCustomizeButton()
      Specified by:
      isEnableCustomizeButton in interface IADTabpanel
      Returns:
      true if customize grid button is enabled
    • updateToolbar

      public void updateToolbar(ADWindowToolbar toolbar)
      Description copied from interface: IADTabpanel
      Enabled/Disabled ADWindowToolbar buttons
      Specified by:
      updateToolbar in interface IADTabpanel
      Parameters:
      toolbar - - ADWindowToolbar
    • updateDetailToolbar

      public void updateDetailToolbar(org.zkoss.zul.Toolbar toolbar)
      Description copied from interface: IADTabpanel
      Enabled/Disabled DetailPane toolbar buttons
      Specified by:
      updateDetailToolbar in interface IADTabpanel
      Parameters:
      toolbar - - Toolbar
    • getADWindowContent

      public AbstractADWindowContent getADWindowContent()
      Returns:
      AbstractADWindowContent