Package org.adempiere.webui.adwindow
Class GridView
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.Layout
org.zkoss.zul.Vlayout
org.adempiere.webui.adwindow.GridView
- 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 GridView
extends org.zkoss.zul.Vlayout
implements org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, org.zkoss.zk.ui.IdSpace, IFieldEditorContainer, StateChangeListener
Grid/List view implemented using the Grid component.
- Author:
- 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
Modifier and TypeFieldDescriptionstatic final String
Column
attribute to store initial/original column width valueprotected boolean
true if there are AD_Tab_Customization for GridTabprotected Checkbox
checkbox to select all row of current pagestatic final String
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Activate GridView (make visible or GridTab have been refreshed)protected void
Auto hide empty columns (if auto hide empty column feature have been turned on)void
clear()
remove all componentsprotected void
create data grid instancesvoid
Deactivate Grid View.void
dynamicDisplay
(int col) Validate display properties of fields of current rowprotected void
echo ON_POST_SELECTED_ROW_CHANGED_EVENT after current row index has changedvoid
editorTraverse
(Callback<WEditor> editorTaverseCallback) call editorTaverseCallback for all field editors.void
focus()
If current row is in edit mode, set focus to first field editorvoid
If current row is in edit mode, set focus to first writable field editor.void
focusToNextEditor
(WEditor ref) set focus to next field editor from reflist field display in grid mode, in case user customize grid this list container only customize list.void
Init data gridvoid
redraw grid viewboolean
boolean
isInit()
boolean
boolean
protected void
Parent component change notification from ADTabpanel that own this GridView instance (Usually after movement between Header and DetailPane panel).void
void
onEditCurrentRow
(org.zkoss.zk.ui.event.Event event) Edit current rowboolean
Handle enter key eventvoid
onEvent
(org.zkoss.zk.ui.event.Event event) void
Event after the current row index has changed.void
Refresh data grid (after switching from form view or column setup has change)void
reInit()
Re-Init GridView with cache gridTab.void
scroll grid to the current focus rowvoid
setADWindowPanel
(AbstractADWindowContent winPanel) Set AD window content part that own this GridView instancevoid
setDetailPaneMode
(boolean detailPaneMode, GridTab gridTab) turn on/off detail pane modevoid
setFocusToField
(String columnName) void
setPageSize
(int pageSize) set paging sizevoid
setWindowNo
(int windowNo) void
stateChange
(StateChangeEvent event) void
Update current row index from modelMethods inherited from class org.zkoss.zul.Vlayout
getZclass
Methods inherited from class org.zkoss.zul.Layout
getSpacing, renderProperties, setSpacing
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, clone, evalCSSFlex, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getPropertyAccess, 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, onPageAttached, onPageDetached, 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
-
ZERO_PX_WIDTH
- See Also:
-
COLUMN_WIDTH_ORIGINAL
Column
attribute to store initial/original column width value- See Also:
-
selectAll
checkbox to select all row of current page -
isHasCustomizeData
protected boolean isHasCustomizeDatatrue if there are AD_Tab_Customization for GridTab
-
-
Constructor Details
-
GridView
public GridView()default constructor -
GridView
public GridView(int windowNo) - Parameters:
windowNo
-
-
-
Method Details
-
createListbox
protected void createListbox()create data grid instances -
setDetailPaneMode
turn on/off detail pane mode- Parameters:
detailPaneMode
-gridTab
-
-
isDetailPaneMode
public boolean isDetailPaneMode()- Returns:
- true if it is in detail pane mode
-
init
Init data grid- Parameters:
gridTab
-
-
isInit
public boolean isInit()- Returns:
- true if data grid have been init with GridTab
-
activate
Activate GridView (make visible or GridTab have been refreshed)- Parameters:
gridTab
-
-
refresh
Refresh data grid (after switching from form view 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 -
autoHideEmptyColumns
protected void autoHideEmptyColumns()Auto hide empty columns (if auto hide empty column feature have been turned on) -
deactivate
public void deactivate()Deactivate Grid View. Stop editing if current row is in edit mode. -
onEvent
- Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Throws:
Exception
-
onPostSelectedRowChanged
public void onPostSelectedRowChanged()Event after the current row index has changed. -
scrollToCurrentRow
public void scrollToCurrentRow()scroll grid to the current focus row -
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
-
-
focus
public void focus()If current row is in edit mode, set focus to first field editor- Overrides:
focus
in classorg.zkoss.zk.ui.HtmlBasedComponent
-
onEnterKey
public boolean onEnterKey()Handle enter key event -
setFocusToField
- Parameters:
columnName
-
-
setADWindowPanel
Set AD window content part that own this GridView instance- Parameters:
winPanel
-
-
reInit
public void reInit()Re-Init GridView with cache gridTab. -
invalidateGridView
public void invalidateGridView()redraw grid view -
getFields
list field display in grid mode, in case user customize grid this list container only customize list.- Returns:
- GridField[]
-
onEditCurrentRow
public void onEditCurrentRow() -
onEditCurrentRow
public void onEditCurrentRow(org.zkoss.zk.ui.event.Event event) Edit current row- Parameters:
event
-
-
focusToFirstEditor
public void focusToFirstEditor()If current row is in edit mode, set focus to first writable field editor.- Specified by:
focusToFirstEditor
in interfaceIFieldEditorContainer
-
focusToNextEditor
Description copied from interface:IFieldEditorContainer
set focus to next field editor from ref- Specified by:
focusToNextEditor
in interfaceIFieldEditorContainer
-
stateChange
- Specified by:
stateChange
in interfaceStateChangeListener
-
onADTabPanelParentChanged
protected void onADTabPanelParentChanged()Parent component change notification from ADTabpanel that own this GridView instance (Usually after movement between Header and DetailPane panel). Re-position paging component. -
editorTraverse
call editorTaverseCallback for all field editors.- Specified by:
editorTraverse
in interfaceIFieldEditorContainer
-
isShowCurrentRowIndicatorColumn
public boolean isShowCurrentRowIndicatorColumn()- Returns:
- true if current row indicator column is visible.
-