Package org.adempiere.webui.adwindow
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
Panel for an AD_Tab content (AD_Tab + AD_Fields).
- 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, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
true if tab have been activatedall collapsible groupsstatic final String
Event after execution ofdynamicDisplay(int)
static final String
post init event for tab panelstatic final String
event after tab panel had switch presentation between form and list viewstatic final String
event to toggle between form and list viewFields 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, AFTER_PARENT_CHANGED, 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(boolean activate) Activate/deactivate this IADTabpanel instance.
Call by init or after tab selection changed.void
Activate selected detail tab if it is visiblevoid
afterSave
(boolean onSaveEvent) Handle after save eventvoid
createUI()
Layout fields of the tab panelprotected void
createUI
(boolean update) Create UI for AD_Fieldsboolean
dataSave
(boolean onSaveEvent) Save changes.
CallGridTab.dataSave(boolean)
void
Data Changedvoid
dynamicDisplay
(int col) Dynamic update of every field's UI properties ( visibility, filter and mandatory ).void
editorTraverse
(Callback<WEditor> editorTaverseCallback) Call editorTaverseCallback for all editors hosted by this containervoid
focus()
protected void
focusToEditor
(WEditor toFocus, boolean checkCurrent) Set focus to editorvoid
set focus to first field editorvoid
focusToFirstEditor
(boolean checkCurrent) Delegate tofocusToEditor(WEditor, boolean)
void
focusToNextEditor
(WEditor ref) Set focus to next readwrite editor from refget_ValueAsString
(String variableName) Get Variable ValueGet parent AD windowGet parent detail paneGet display logicGet GridTab of tabGet GridView componentint
Get record id of current rowGet table nameint
Get tab levelint
getTabNo()
Get tab nogetTitle()
Get title of tabList<org.zkoss.zul.Button>
Get toolbar buttonsWhen tree should be visibleGet tree panel componentint
Get window numberboolean
Is selected header tab has one or more detail tabvoid
init
(AbstractADWindowContent winPanel, GridTab gridTab) Initialize tab panel layout (formContainer
and listenersboolean
Is tab panel have been activatedboolean
Is current row not stallboolean
Is tab panel in detail pane modeboolean
Get is detail pane visibleboolean
Is customize grid button enableboolean
Is quick form enabledboolean
Is tab panel showing grid viewprotected boolean
isMobile()
Is client using mobile browserboolean
needSave
(boolean rowChange, boolean onlyRealChange) void
After Find window closes switch to grid view if configuredprotected void
handle client info eventboolean
Handle enter key eventvoid
onEvent
(org.zkoss.zk.ui.event.Event event) void
onPageDetached
(org.zkoss.zk.ui.Page page) void
query()
Retrieve from DB.
Delegate toGridTab.query(boolean)
void
query
(boolean onlyCurrentRows, int onlyCurrentDays, int maxRows) void
refresh()
Refresh data through the backedGridTab
instance.void
Reset detail data grid when current record of parent tab is new and not saved yet.
CallGridTab.resetDetailForNewParentRecord()
protected void
savePreference
(String attribute, String value) Save user preference for this AD Windowvoid
setDetailPane
(DetailPane component) Set theDetailPane
part that own this IADTabpanel instancevoid
setDetailPaneMode
(boolean detailPaneMode) Turn on/off detail mode, i.e whether tab panel is currently a header or detail tab of the window.void
setFocusToField
(String columnName) Set field focus by column namevoid
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_Windowvoid
Switch between grid and form viewvoid
updateDetailToolbar
(org.zkoss.zul.Toolbar toolbar) UpdateDetailPane
toolbar buttons statevoid
updateToolbar
(ADWindowToolbar toolbar) Update ADWindowToolbar buttons stateMethods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, renderProperties, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setClientAction, 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, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, 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, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, 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, 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, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getShadowVariable, getShadowVariable, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, 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, setWidgetClass, setWidgetListener, setWidgetOverride
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
post init event for tab panel- See Also:
-
ON_SWITCH_VIEW_EVENT
event after tab panel had switch presentation between form and list view- See Also:
-
ON_DYNAMIC_DISPLAY_EVENT
Event after execution ofdynamicDisplay(int)
- See Also:
-
allCollapsibleGroups
all collapsible groups -
activated
protected boolean activatedtrue if tab have been activated -
ON_TOGGLE_EVENT
event to toggle between form and list view- See Also:
-
-
Constructor Details
-
ADTabpanel
public ADTabpanel()default constructor
-
-
Method Details
-
setDetailPane
Description copied from interface:IADTabpanel
Set theDetailPane
part that own this IADTabpanel instance- Specified by:
setDetailPane
in interfaceIADTabpanel
-
getDetailPane
Description copied from interface:IADTabpanel
Get parent detail pane- Specified by:
getDetailPane
in interfaceIADTabpanel
- Returns:
- the
DetailPane
part that own this IADTabpanel instance
-
init
Initialize tab panel layout (formContainer
and listeners- Specified by:
init
in interfaceIADTabpanel
- Parameters:
winPanel
-gridTab
-
-
createUI
public void createUI()Description copied from interface:IADTabpanel
Layout fields of the tab panel- Specified by:
createUI
in interfaceIADTabpanel
-
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) Description copied from interface:IADTabpanel
Dynamic update of every field's UI properties ( visibility, filter and mandatory ).- Specified by:
dynamicDisplay
in interfaceIADTabpanel
- Parameters:
col
- optional column name
-
getDisplayLogic
Description copied from interface:IADTabpanel
Get display logic- Specified by:
getDisplayLogic
in interfaceIADTabpanel
- Returns:
- display logic
-
getTitle
Description copied from interface:IADTabpanel
Get title of tab- Specified by:
getTitle
in interfaceIADTabpanel
- Returns:
- title of tab
-
get_ValueAsString
Description copied from interface:Evaluatee
Get Variable Value- Specified by:
get_ValueAsString
in interfaceEvaluatee
- Parameters:
variableName
- name- Returns:
- value
-
getTabLevel
public int getTabLevel()Description copied from interface:IADTabpanel
Get tab level- Specified by:
getTabLevel
in interfaceIADTabpanel
- Returns:
- tab level
-
getTableName
Description copied from interface:IADTabpanel
Get table name- Specified by:
getTableName
in interfaceIADTabpanel
- Returns:
- table name from GridTab
-
getRecord_ID
public int getRecord_ID()Description copied from interface:IADTabpanel
Get record id of current row- Specified by:
getRecord_ID
in interfaceIADTabpanel
- Returns:
- record ID of current row
-
isCurrent
public boolean isCurrent()Description copied from interface:IADTabpanel
Is current row not stall- Specified by:
isCurrent
in interfaceIADTabpanel
- Returns:
- true if refresh is not needed
-
getWindowNo
public int getWindowNo()Get window number- Returns:
- windowNo
-
query
public void query()Retrieve from DB.
Delegate toGridTab.query(boolean)
- Specified by:
query
in interfaceIADTabpanel
-
query
public void query(boolean onlyCurrentRows, int onlyCurrentDays, int maxRows) Description copied from interface:IADTabpanel
- Specified by:
query
in interfaceIADTabpanel
-
resetDetailForNewParentRecord
public void resetDetailForNewParentRecord()Description copied from interface:IADTabpanel
Reset detail data grid when current record of parent tab is new and not saved yet.
CallGridTab.resetDetailForNewParentRecord()
- Specified by:
resetDetailForNewParentRecord
in interfaceIADTabpanel
-
getGridTab
Description copied from interface:IADTabpanel
Get GridTab of tab- Specified by:
getGridTab
in interfaceIADTabpanel
- Returns:
GridTab
instance that back this IADTabpanel instance
-
getTreePanel
Description copied from interface:IADTabpanel
Get tree panel component- Specified by:
getTreePanel
in interfaceIADTabpanel
- Returns:
ADTreePanel
instance
-
getTreeDisplayedOn
When tree should be visible- Returns:
- master, detail or both
-
refresh
public void refresh()Description copied from interface:IADTabpanel
Refresh data through the backedGridTab
instance.- Specified by:
refresh
in interfaceIADTabpanel
-
activate
public void activate(boolean activate) Description copied from interface:IADTabpanel
Activate/deactivate this IADTabpanel instance.
Call by init or after tab selection changed.- Specified by:
activate
in interfaceIADTabpanel
-
focusToFirstEditor
public void focusToFirstEditor()Description copied from interface:IFieldEditorContainer
set focus to first field editor- Specified by:
focusToFirstEditor
in interfaceIFieldEditorContainer
-
focusToFirstEditor
public void focusToFirstEditor(boolean checkCurrent) Delegate tofocusToEditor(WEditor, boolean)
- Parameters:
checkCurrent
-
-
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event event) - Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
-
setSelectedNode
public void setSelectedNode()Set selected tree node for current row (if there's tree) -
dataStatusChanged
Description copied from interface:DataStatusListener
Data Changed- Specified by:
dataStatusChanged
in interfaceDataStatusListener
- Parameters:
e
- event
-
switchRowPresentation
public void switchRowPresentation()Description copied from interface:IADTabpanel
Switch between grid and form view- Specified by:
switchRowPresentation
in interfaceIADTabpanel
-
onAfterFind
public void onAfterFind()After Find window closes switch to grid view if configured- Specified by:
onAfterFind
in interfaceIADTabpanel
-
afterSave
public void afterSave(boolean onSaveEvent) Description copied from interface:IADTabpanel
Handle after save event- Specified by:
afterSave
in interfaceIADTabpanel
- See Also:
-
focus
public void focus()- Overrides:
focus
in classorg.zkoss.zk.ui.HtmlBasedComponent
-
setFocusToField
Set field focus by column name- Parameters:
columnName
-
-
onEnterKey
public boolean onEnterKey()Description copied from interface:IADTabpanel
Handle enter key event- Specified by:
onEnterKey
in interfaceIADTabpanel
- Returns:
- true if the event is process
- See Also:
-
isGridView
public boolean isGridView()Description copied from interface:IADTabpanel
Is tab panel showing grid view- Specified by:
isGridView
in interfaceIADTabpanel
- Returns:
- true if current presentation of the tab panel is grid/list view
-
getGridView
Description copied from interface:IADTabpanel
Get GridView component- Specified by:
getGridView
in interfaceIADTabpanel
- Returns:
GridView
instance
-
isActivated
public boolean isActivated()Description copied from interface:IADTabpanel
Is tab panel have been activated- Specified by:
isActivated
in interfaceIADTabpanel
- 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 whether tab panel is currently a header or detail tab of the window.- Specified by:
setDetailPaneMode
in interfaceIADTabpanel
-
getToolbarButtons
Description copied from interface:IADTabpanel
Get toolbar buttons- Specified by:
getToolbarButtons
in interfaceIADTabpanel
- Returns:
- List of toolbar buttons
-
needSave
public boolean needSave(boolean rowChange, boolean onlyRealChange) Description copied from interface:IADTabpanel
- Specified by:
needSave
in interfaceIADTabpanel
- Returns:
- true if there are pending changes
-
dataSave
public boolean dataSave(boolean onSaveEvent) Description copied from interface:IADTabpanel
Save changes.
CallGridTab.dataSave(boolean)
- Specified by:
dataSave
in interfaceIADTabpanel
- Returns:
- true if the save operation completed successfully
-
isDetailPaneMode
public boolean isDetailPaneMode()Description copied from interface:IADTabpanel
Is tab panel in detail pane mode- Specified by:
isDetailPaneMode
in interfaceIADTabpanel
- Returns:
- true if the panel is in detail mode (i.e a 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 interfaceIADTabpanel
-
getTabNo
public int getTabNo()Description copied from interface:IADTabpanel
Get tab no- Specified by:
getTabNo
in interfaceIADTabpanel
- 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 interfaceIADTabpanel
- Returns:
- true if the containing
DetailPane
instance is visible
-
hasDetailTabs
public boolean hasDetailTabs()Is selected header tab has one or more detail tab- Returns:
- true if selected tab has one or more detail/child tab
-
focusToNextEditor
Set focus to next readwrite editor from ref- Specified by:
focusToNextEditor
in interfaceIFieldEditorContainer
- Parameters:
ref
-
-
focusToEditor
Set focus to editor- 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 interfaceorg.zkoss.zk.ui.Component
- Overrides:
setParent
in classorg.zkoss.zk.ui.AbstractComponent
-
onPageDetached
public void onPageDetached(org.zkoss.zk.ui.Page page) - Specified by:
onPageDetached
in interfaceorg.zkoss.zk.ui.sys.ComponentCtrl
- Overrides:
onPageDetached
in classorg.zkoss.zk.ui.AbstractComponent
-
savePreference
Save user preference for this AD Window- Parameters:
attribute
-value
-
-
onClientInfo
protected void onClientInfo()handle client info event -
isMobile
protected boolean isMobile()Is client using mobile browser- Returns:
- true if client is mobile
-
editorTraverse
Description copied from interface:IFieldEditorContainer
Call editorTaverseCallback for all editors hosted by this container- Specified by:
editorTraverse
in interfaceIFieldEditorContainer
-
isEnableQuickFormButton
public boolean isEnableQuickFormButton()Description copied from interface:IADTabpanel
Is quick form enabled- Specified by:
isEnableQuickFormButton
in interfaceIADTabpanel
- Returns:
- true if Quick Form Button is Enabled
-
isEnableCustomizeButton
public boolean isEnableCustomizeButton()Description copied from interface:IADTabpanel
Is customize grid button enable- Specified by:
isEnableCustomizeButton
in interfaceIADTabpanel
- Returns:
- true if customize grid button is enabled
-
updateToolbar
Description copied from interface:IADTabpanel
Update ADWindowToolbar buttons state- Specified by:
updateToolbar
in interfaceIADTabpanel
- Parameters:
toolbar
- -ADWindowToolbar
-
updateDetailToolbar
public void updateDetailToolbar(org.zkoss.zul.Toolbar toolbar) Description copied from interface:IADTabpanel
UpdateDetailPane
toolbar buttons state- Specified by:
updateDetailToolbar
in interfaceIADTabpanel
- Parameters:
toolbar
- -Toolbar
-
getADWindowContent
Get parent AD window- Returns:
AbstractADWindowContent
-