Package org.adempiere.webui.adwindow
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, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
shortcut key for cell navigationstatic 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 GridTabboolean
true if no new row or new row have been savedprotected org.zkforge.keylistener.Keylistener
reference to desktop key listenerZk List model fortableModel
static final int
org.zkoss.zul.Paging
IQuickForm that own this QuickGridView instancestatic final int
protected Checkbox
checkbox to select all row of current pageFields 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
-
Constructor Summary
ConstructorDescriptionQuickGridView
(int windowNo) QuickGridView
(AbstractADWindowContent abstractADWindowContent, GridTab gridTab, IQuickForm wQuickForm) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
remove all componentsprotected void
create data grid instancesvoid
add new row to data gridboolean
dataSave
(int code) Save changesvoid
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 editors hosted by this containerorg.zkoss.zul.Column
void
set focus to first field editorvoid
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.List field display in grid mode.void
Init data gridboolean
boolean
isInit()
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 data grid (int of quick form or column setup has change)void
reInit()
Re-Init QuickGridView with cache gridTab.void
scroll grid to the current focus rowvoid
setADWindowPanel
(AbstractADWindowContent winPanel) Set AD window content part that own this QuickGridView instancevoid
setGridField
(GridField[] gridField) void
setPageSize
(int pageSize) set paging sizevoid
setStatusLine
(String text, boolean error) set status textvoid
setWindowNo
(int windowNo) void
stateChange
(StateChangeEvent event) State change eventvoid
toggleSelectionForAll
(boolean b) turn on/off select all rows for current pagevoid
Update current row index from modelboolean
updateModelIndex
(int rowIndex) Update gridTab current row index.Methods inherited from class org.zkoss.zul.Box
evalCSSFlex, getAlign, getOrient, getPack, getPropertyAccess, getSpacing, getZclass, isHorizontal, isSizedByContent, isVertical, renderProperties, setAlign, setOrient, setPack, setSizedByContent, setSpacing
Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, 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, 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, setParent, 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.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
shortcut key for cell navigation- See Also:
-
EVENT_ON_SELECT_ROW
- See Also:
-
EVENT_ON_CUSTOMIZE_GRID
- See Also:
-
EVENT_ON_PAGE_NAVIGATE
- See Also:
-
EVENT_ON_CLICK_TO_NAVIGATE
- See Also:
-
EVENT_ON_SET_FOCUS_TO_FIRST_CELL
- See Also:
-
EVENT_ON_AFTER_SAVE
- See Also:
-
EVENT_ONFOCUS_AFTER_SAVE
- See Also:
-
NAVIGATE_CODE
public static final int NAVIGATE_CODE- See Also:
-
FOCUS_CODE
public static final int FOCUS_CODE- See Also:
-
listModel
Zk List model fortableModel
-
paging
public org.zkoss.zul.Paging paging -
selectAll
checkbox to select all row of current page -
isHasCustomizeData
protected boolean isHasCustomizeDatatrue if there are AD_Tab_Customization for GridTab -
keyListener
protected org.zkforge.keylistener.Keylistener keyListenerreference to desktop key listener -
isNewLineSaved
public boolean isNewLineSavedtrue if no new row or new row have been saved -
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
List field display in grid mode. If there are user customize grid record, this list contain only the customized display list.- Returns:
- GridField[]
-
setGridField
- Parameters:
gridField
-
-
getRenderer
- Returns:
QuickGridTabRowRenderer
-
createListbox
protected void createListbox()create data grid instances -
init
Init data grid- Parameters:
gridTab
-
-
isInit
public boolean isInit()- Returns:
- true if data grid have been init with GridTab
-
refresh
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
- Specified by:
onEvent
in interfaceorg.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
- 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
Set AD window content part that own this QuickGridView instance- Parameters:
winPanel
-
-
reInit
public void reInit()Re-Init QuickGridView with cache gridTab. -
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 interfaceIFieldEditorContainer
-
focusToNextEditor
Description copied from interface:IFieldEditorContainer
set focus to next field editor from ref- Specified by:
focusToNextEditor
in interfaceIFieldEditorContainer
-
stateChange
Description copied from interface:StateChangeListener
State change event- Specified by:
stateChange
in interfaceStateChangeListener
-
onADTabPanelParentChanged
protected void onADTabPanelParentChanged()not used. candidate for removal. -
setStatusLine
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 interfaceorg.zkoss.zk.ui.sys.ComponentCtrl
- Overrides:
onPageAttached
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
-
editorTraverse
Description copied from interface:IFieldEditorContainer
Call editorTaverseCallback for all editors hosted by this container- Specified by:
editorTraverse
in interfaceIFieldEditorContainer
-
findCurrentSortColumn
public org.zkoss.zul.Column findCurrentSortColumn()- Returns:
- sort column (if any)
-