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
This class is based on org.compiere.grid.GridController written by Jorg Janke. Changes have been brought for UI compatibility.- Version:
- $Revision: 0.10 $
- Author:
- Jorg Janke, Ashley G Ramdass, Low Heng Sin
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
activated
static String
ON_DYNAMIC_DISPLAY_EVENT
static String
ON_POST_INIT_EVENT
static String
ON_SWITCH_VIEW_EVENT
static String
ON_TOGGLE_EVENT
-
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 ADTabpanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(boolean activate)
Activate/deactivate panelvoid
activateDetailIfVisible()
activate current selected detail tab if it is visiblevoid
afterSave(boolean onSaveEvent)
After save eventvoid
createUI()
Create UI components if not already createdprotected void
createUI(boolean update)
boolean
dataSave(boolean onSaveEvent)
void
dataStatusChanged(DataStatusEvent e)
Data Changedvoid
dynamicDisplay(int col)
Validate display properties of fields of current row.void
editorTraverse(Callback<WEditor> editorTaverseCallback)
helper method to loop thru editor collection of panel
can use on callout to check relative editorvoid
focus()
protected void
focusToEditor(WEditor toFocus, boolean checkCurrent)
void
focusToFirstEditor()
set focus to first active editorvoid
focusToFirstEditor(boolean checkCurrent)
void
focusToNextEditor(WEditor ref)
set focus to next readwrite editor from refString
get_ValueAsString(String variableName)
Get Variable ValueDetailPane
getDetailPane()
String
getDisplayLogic()
GridTab
getGridTab()
GridView
getGridView()
int
getRecord_ID()
String
getTableName()
int
getTabLevel()
int
getTabNo()
String
getTitle()
List<org.zkoss.zul.Button>
getToolbarButtons()
Get all visible button editorsString
getTreeDisplayedOn()
ADTreePanel
getTreePanel()
int
getWindowNo()
boolean
hasDetailTabs()
void
init(AbstractADWindowContent winPanel, GridTab gridTab)
boolean
isActivated()
boolean
isCurrent()
Is panel need refreshboolean
isDetailPaneMode()
boolean
isDetailVisible()
Get is detail pane visibleboolean
isEnableCustomizeButton()
boolean
isEnableQuickFormButton()
boolean
isGridView()
protected boolean
isMobile()
boolean
needSave(boolean rowChange, boolean onlyRealChange)
protected void
onClientInfo()
boolean
onEnterKey()
Enter key eventvoid
onEvent(org.zkoss.zk.ui.event.Event event)
void
onPageDetached(org.zkoss.zk.ui.Page page)
void
query()
Retrieve from dbvoid
query(boolean onlyCurrentRows, int onlyCurrentDays, int maxRows)
Retrieve from dbvoid
refresh()
Refresh current rowvoid
resetDetailForNewParentRecord()
reset detail data grid for new parent record that's not saved yetvoid
setDetailPane(DetailPane component)
void
setDetailPaneMode(boolean detailPaneMode)
void
setFocusToField(String columnName)
void
setParent(org.zkoss.zk.ui.Component parent)
void
setSelectedNode()
set selected tree node for current row (if there's tree)void
setTabNo(int tabNo)
void
switchRowPresentation()
Toggle between form and grid viewvoid
updateDetailToolbar(org.zkoss.zul.Toolbar toolbar)
Enabled/Disabled detail panel toolbar buttonvoid
updateToolbar(ADWindowToolbar toolbar)
Enabled/Disabled tab toolbar button-
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.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
-
-
-
-
Field Detail
-
ON_POST_INIT_EVENT
public static final String ON_POST_INIT_EVENT
- See Also:
- Constant Field Values
-
ON_SWITCH_VIEW_EVENT
public static final String ON_SWITCH_VIEW_EVENT
- See Also:
- Constant Field Values
-
ON_DYNAMIC_DISPLAY_EVENT
public static final String ON_DYNAMIC_DISPLAY_EVENT
- See Also:
- Constant Field Values
-
activated
protected boolean activated
-
ON_TOGGLE_EVENT
public static final String ON_TOGGLE_EVENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDetailPane
public void setDetailPane(DetailPane component)
- Specified by:
setDetailPane
in interfaceIADTabpanel
-
getDetailPane
public DetailPane getDetailPane()
- Specified by:
getDetailPane
in interfaceIADTabpanel
- Returns:
- detailpane
-
init
public void init(AbstractADWindowContent winPanel, GridTab gridTab)
- Specified by:
init
in interfaceIADTabpanel
- Parameters:
winPanel
-gridTab
-
-
createUI
public void createUI()
Create UI components if not already created- Specified by:
createUI
in interfaceIADTabpanel
-
createUI
protected void createUI(boolean update)
-
dynamicDisplay
public void dynamicDisplay(int col)
Validate display properties of fields of current row.- Specified by:
dynamicDisplay
in interfaceIADTabpanel
- Parameters:
col
-
-
getDisplayLogic
public String getDisplayLogic()
- Specified by:
getDisplayLogic
in interfaceIADTabpanel
- Returns:
- String
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfaceIADTabpanel
- Returns:
- String
-
get_ValueAsString
public String get_ValueAsString(String variableName)
Description copied from interface:Evaluatee
Get Variable Value- Specified by:
get_ValueAsString
in interfaceEvaluatee
- Parameters:
variableName
-- Returns:
- value
-
getTabLevel
public int getTabLevel()
- Specified by:
getTabLevel
in interfaceIADTabpanel
- Returns:
- The tab level of this Tabpanel
-
getTableName
public String getTableName()
- Specified by:
getTableName
in interfaceIADTabpanel
- Returns:
- The tablename of this Tabpanel
-
getRecord_ID
public int getRecord_ID()
- Specified by:
getRecord_ID
in interfaceIADTabpanel
- Returns:
- The record ID of this Tabpanel
-
isCurrent
public boolean isCurrent()
Is panel need refresh- Specified by:
isCurrent
in interfaceIADTabpanel
- Returns:
- boolean
-
getWindowNo
public int getWindowNo()
- Returns:
- windowNo
-
query
public void query()
Retrieve from db- Specified by:
query
in interfaceIADTabpanel
-
query
public void query(boolean onlyCurrentRows, int onlyCurrentDays, int maxRows)
Retrieve from db- Specified by:
query
in interfaceIADTabpanel
- Parameters:
onlyCurrentRows
-onlyCurrentDays
-maxRows
-
-
resetDetailForNewParentRecord
public void resetDetailForNewParentRecord()
reset detail data grid for new parent record that's not saved yet- Specified by:
resetDetailForNewParentRecord
in interfaceIADTabpanel
-
getGridTab
public GridTab getGridTab()
- Specified by:
getGridTab
in interfaceIADTabpanel
- Returns:
- GridTab
-
getTreePanel
public ADTreePanel getTreePanel()
- Specified by:
getTreePanel
in interfaceIADTabpanel
- Returns:
- TreePanel
-
getTreeDisplayedOn
public String getTreeDisplayedOn()
- Returns:
- TreePanel
-
refresh
public void refresh()
Refresh current row- Specified by:
refresh
in interfaceIADTabpanel
-
activate
public void activate(boolean activate)
Activate/deactivate panel- Specified by:
activate
in interfaceIADTabpanel
- Parameters:
activate
-
-
focusToFirstEditor
public void focusToFirstEditor()
set focus to first active editor- Specified by:
focusToFirstEditor
in interfaceIFieldEditorContainer
-
focusToFirstEditor
public void focusToFirstEditor(boolean checkCurrent)
- 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>
- 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 interfaceDataStatusListener
- Parameters:
e
-- See Also:
DataStatusListener.dataStatusChanged(DataStatusEvent)
-
switchRowPresentation
public void switchRowPresentation()
Toggle between form and grid view- Specified by:
switchRowPresentation
in interfaceIADTabpanel
-
afterSave
public void afterSave(boolean onSaveEvent)
Description copied from interface:IADTabpanel
After save event- Specified by:
afterSave
in interfaceIADTabpanel
- See Also:
IADTabpanel.afterSave(boolean)
-
focus
public void focus()
- Overrides:
focus
in classorg.zkoss.zk.ui.HtmlBasedComponent
-
setFocusToField
public void setFocusToField(String columnName)
- Parameters:
columnName
-
-
onEnterKey
public boolean onEnterKey()
Description copied from interface:IADTabpanel
Enter key event- Specified by:
onEnterKey
in interfaceIADTabpanel
- Returns:
- true if the event is process
- See Also:
IADTabpanel.onEnterKey()
-
isGridView
public boolean isGridView()
- Specified by:
isGridView
in interfaceIADTabpanel
- Returns:
- boolean
-
getGridView
public GridView getGridView()
- Specified by:
getGridView
in interfaceIADTabpanel
- Returns:
- GridPanel
-
isActivated
public boolean isActivated()
- Specified by:
isActivated
in interfaceIADTabpanel
- Returns:
- true if the panel have been activated
-
setDetailPaneMode
public void setDetailPaneMode(boolean detailPaneMode)
- Specified by:
setDetailPaneMode
in interfaceIADTabpanel
-
getToolbarButtons
public List<org.zkoss.zul.Button> getToolbarButtons()
Get all visible button editors- Specified by:
getToolbarButtons
in interfaceIADTabpanel
- Returns:
- List
-
needSave
public boolean needSave(boolean rowChange, boolean onlyRealChange)
- Specified by:
needSave
in interfaceIADTabpanel
- Returns:
- true if there are pending changes
-
dataSave
public boolean dataSave(boolean onSaveEvent)
- Specified by:
dataSave
in interfaceIADTabpanel
- Returns:
- true if the save operation completed successfully
-
isDetailPaneMode
public boolean isDetailPaneMode()
- Specified by:
isDetailPaneMode
in interfaceIADTabpanel
- Returns:
- true if the panel is in detailpane node
-
setTabNo
public void setTabNo(int tabNo)
- Specified by:
setTabNo
in interfaceIADTabpanel
-
getTabNo
public int getTabNo()
- Specified by:
getTabNo
in interfaceIADTabpanel
- Returns:
- tab no ( ad_tab.tabno )
-
activateDetailIfVisible
public void activateDetailIfVisible()
activate current 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 detailpane is visible
-
hasDetailTabs
public boolean hasDetailTabs()
- Returns:
- true if have one or more detail tabs
-
focusToNextEditor
public void focusToNextEditor(WEditor ref)
set focus to next readwrite editor from ref- Specified by:
focusToNextEditor
in interfaceIFieldEditorContainer
- Parameters:
ref
-
-
focusToEditor
protected void focusToEditor(WEditor toFocus, boolean checkCurrent)
-
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
-
onClientInfo
protected void onClientInfo()
-
isMobile
protected boolean isMobile()
-
editorTraverse
public void editorTraverse(Callback<WEditor> editorTaverseCallback)
Description copied from interface:IFieldEditorContainer
helper method to loop thru editor collection of panel
can use on callout to check relative editor- Specified by:
editorTraverse
in interfaceIFieldEditorContainer
-
isEnableQuickFormButton
public boolean isEnableQuickFormButton()
- Specified by:
isEnableQuickFormButton
in interfaceIADTabpanel
- Returns:
- Quick Form Button Enabled/Disabled
-
isEnableCustomizeButton
public boolean isEnableCustomizeButton()
- Specified by:
isEnableCustomizeButton
in interfaceIADTabpanel
- Returns:
- customization enabled/disabled for tab
-
updateToolbar
public void updateToolbar(ADWindowToolbar toolbar)
Description copied from interface:IADTabpanel
Enabled/Disabled tab toolbar button- Specified by:
updateToolbar
in interfaceIADTabpanel
- Parameters:
toolbar
- -ADWindowToolbar
-
updateDetailToolbar
public void updateDetailToolbar(org.zkoss.zul.Toolbar toolbar)
Description copied from interface:IADTabpanel
Enabled/Disabled detail panel toolbar button- Specified by:
updateDetailToolbar
in interfaceIADTabpanel
- Parameters:
toolbar
- -Toolbar
-
-