Package org.adempiere.webui.adwindow
Class ADSortTab
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.component.Panel
org.adempiere.webui.adwindow.ADSortTab
- All Implemented Interfaces:
Serializable,Cloneable,IADTabpanel,Evaluatee,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
Tab to maintain Order/Sequence
- Author:
- Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
FR [ 1779410 ] VSortTab: display ID for not visible columns, victor.perez@e-evolution.com, e-Evolution
FR [ 2826406 ] The Tab Sort without parent column
- https://sourceforge.net/p/adempiere/feature-requests/776/ Zk Port, Low Heng Sin, Juan David Arboleda : Refactoring Yes and No List to work with multiple choice.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested 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
FieldsModifier and TypeFieldDescriptionprotected static final CLoggerLoggerprotected Listboxprotected SimpleListModelprotected Listboxprotected SimpleListModelFields inherited from class org.adempiere.webui.component.Panel
HORIZONTAL, VERTICALFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields 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_IGNOREFields inherited from interface org.adempiere.webui.adwindow.IADTabpanel
ATTR_ON_ACTIVATE_POSTED, ON_ACTIVATE_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(boolean b) Activate/deactivate this IADTabpanel instance.
Call by init or after tab selection changed.voidafterSave(boolean onSaveEvent) Handle after save eventvoidcreateUI()Layout fields of the tab panelbooleandataSave(boolean onSaveEvent) Save changes.
CallGridTab.dataSave(boolean)voiddynamicDisplay(int i) Dynamic update of every field's UI properties ( visibility, filter and mandatory ).voideditRecord(boolean b) Deprecated, for removal: This API element is subject to removal in a future version.get_ValueAsString(String variableName) Get Variable ValueGet parent detail paneGet display logicGet GridTab of tabGet GridView componentintGet record id of current rowGet table nameintGet tab levelintgetTabNo()Get tab nogetTitle()Get title of tabList<org.zkoss.zul.Button>Get toolbar buttonsGet tree panel componentvoidinit(AbstractADWindowContent winPanel, GridTab gridTab) InitiatebooleanIs tab panel have been activatedbooleanIs tab has changesbooleanIs current row not stallbooleanIs tab panel in detail pane modebooleanIs customize grid button enablebooleanIs process button enablebooleanIs quick form enabledbooleanIs tab panel showing grid viewvoidloadData()Load dataprotected voidmigrateLists(Listbox listFrom, Listbox listTo, int endIndex) Move an item from listFrom to listTo.protected voidmigrateValueAcrossLists(org.zkoss.zk.ui.event.Event event) Move an item between yes and no list.
Delegate tomigrateLists(Listbox, Listbox, int)protected voidmigrateValueWithinYesList(int endIndex, List<org.adempiere.webui.adwindow.ADSortTab.ListElement> selObjects) Move items within Yes List with Drag Event and Multiple Choiceprotected voidmigrateValueWithinYesList(org.zkoss.zk.ui.event.Event event) Move an item within Yes ListbooleanneedSave(boolean rowChange, boolean onlyRealChange) voidAfter Find window closes switch to grid view if configuredbooleanHandle enter key eventvoidquery()Execute query through the backedGridTabinstance.voidquery(boolean currentRows, int currentDays, int i) voidrefresh()Refresh data through the backedGridTabinstance.voidSet AD Window content part that own this ADSortTab instance.voidReset detail data grid when current record of parent tab is new and not saved yet.
CallGridTab.resetDetailForNewParentRecord()voidsaveData()Save changes to db.voidsetDetailPane(DetailPane detailPane) Set theDetailPanepart that own this IADTabpanel instancevoidsetDetailPaneMode(boolean detailMode) Turn on/off detail mode, i.e whether tab panel is currently a header or detail tab of the window.voidsetIsChanged(boolean value) Set tab change status.voidsetTabNo(int tabNo) Set tab number/sequence within an AD_WindowvoidSwitch between grid and form viewvoidupdateDetailToolbar(org.zkoss.zul.Toolbar toolbar) UpdateDetailPanetoolbar buttons statevoidupdateToolbar(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, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, 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, setZIndexDirectlyMethods 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, onPageDetached, 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, willSerializeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, setParent, setStubonly, setStubonly, setTemplate, setVisible, setWidgetClass, setWidgetListener, setWidgetOverrideMethods inherited from interface org.adempiere.webui.adwindow.IADTabpanel
isDetailVisibleMethods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
-
Field Details
-
log
Logger -
noModel
-
yesModel
-
noList
-
yesList
-
-
Constructor Details
-
ADSortTab
public ADSortTab()default constructor
-
-
Method Details
-
init
Initiate- Specified by:
initin interfaceIADTabpanel- Parameters:
winPanel-gridTab-
-
loadData
public void loadData()Load data -
setIsChanged
public void setIsChanged(boolean value) Set tab change status.- Parameters:
value- true for dirty/changed state, false otherwise
-
isChanged
public boolean isChanged()Is tab has changes- Returns:
- true if tab has changes
-
migrateValueAcrossLists
protected void migrateValueAcrossLists(org.zkoss.zk.ui.event.Event event) Move an item between yes and no list.
Delegate tomigrateLists(Listbox, Listbox, int)- Parameters:
event-
-
migrateLists
Move an item from listFrom to listTo.- Parameters:
listFrom-listTo-endIndex- destination index
-
migrateValueWithinYesList
protected void migrateValueWithinYesList(org.zkoss.zk.ui.event.Event event) Move an item within Yes List- Parameters:
event- event
-
migrateValueWithinYesList
protected void migrateValueWithinYesList(int endIndex, List<org.adempiere.webui.adwindow.ADSortTab.ListElement> selObjects) Move items within Yes List with Drag Event and Multiple Choice- Parameters:
endIndex- move items after endIndexselObjects- selected items to move
-
registerAPanel
Set AD Window content part that own this ADSortTab instance.- Parameters:
panel-
-
saveData
public void saveData()Save changes to db. -
activate
public void activate(boolean b) Description copied from interface:IADTabpanelActivate/deactivate this IADTabpanel instance.
Call by init or after tab selection changed.- Specified by:
activatein interfaceIADTabpanel
-
createUI
public void createUI()Description copied from interface:IADTabpanelLayout fields of the tab panel- Specified by:
createUIin interfaceIADTabpanel
-
dynamicDisplay
public void dynamicDisplay(int i) Description copied from interface:IADTabpanelDynamic update of every field's UI properties ( visibility, filter and mandatory ).- Specified by:
dynamicDisplayin interfaceIADTabpanel- Parameters:
i- optional column name
-
editRecord
Deprecated, for removal: This API element is subject to removal in a future version. -
getDisplayLogic
Description copied from interface:IADTabpanelGet display logic- Specified by:
getDisplayLogicin interfaceIADTabpanel- Returns:
- display logic
-
getGridTab
Description copied from interface:IADTabpanelGet GridTab of tab- Specified by:
getGridTabin interfaceIADTabpanel- Returns:
GridTabinstance that back this IADTabpanel instance
-
getTabLevel
public int getTabLevel()Description copied from interface:IADTabpanelGet tab level- Specified by:
getTabLevelin interfaceIADTabpanel- Returns:
- tab level
-
getTableName
Description copied from interface:IADTabpanelGet table name- Specified by:
getTableNamein interfaceIADTabpanel- Returns:
- table name from GridTab
-
getRecord_ID
public int getRecord_ID()Description copied from interface:IADTabpanelGet record id of current row- Specified by:
getRecord_IDin interfaceIADTabpanel- Returns:
- record ID of current row
-
getTitle
Description copied from interface:IADTabpanelGet title of tab- Specified by:
getTitlein interfaceIADTabpanel- Returns:
- title of tab
-
isCurrent
public boolean isCurrent()Description copied from interface:IADTabpanelIs current row not stall- Specified by:
isCurrentin interfaceIADTabpanel- Returns:
- true if refresh is not needed
-
query
public void query()Description copied from interface:IADTabpanelExecute query through the backedGridTabinstance.- Specified by:
queryin interfaceIADTabpanel
-
query
public void query(boolean currentRows, int currentDays, int i) Description copied from interface:IADTabpanel- Specified by:
queryin interfaceIADTabpanel
-
refresh
public void refresh()Description copied from interface:IADTabpanelRefresh data through the backedGridTabinstance.- Specified by:
refreshin interfaceIADTabpanel
-
switchRowPresentation
public void switchRowPresentation()Description copied from interface:IADTabpanelSwitch between grid and form view- Specified by:
switchRowPresentationin interfaceIADTabpanel
-
onAfterFind
public void onAfterFind()Description copied from interface:IADTabpanelAfter Find window closes switch to grid view if configured- Specified by:
onAfterFindin interfaceIADTabpanel
-
get_ValueAsString
Description copied from interface:EvaluateeGet Variable Value- Specified by:
get_ValueAsStringin interfaceEvaluatee- Parameters:
variableName- name- Returns:
- value
-
afterSave
public void afterSave(boolean onSaveEvent) Description copied from interface:IADTabpanelHandle after save event- Specified by:
afterSavein interfaceIADTabpanel
-
onEnterKey
public boolean onEnterKey()Description copied from interface:IADTabpanelHandle enter key event- Specified by:
onEnterKeyin interfaceIADTabpanel- Returns:
- true if the event is process
-
isGridView
public boolean isGridView()Description copied from interface:IADTabpanelIs tab panel showing grid view- Specified by:
isGridViewin interfaceIADTabpanel- Returns:
- true if current presentation of the tab panel is grid/list view
-
isActivated
public boolean isActivated()Description copied from interface:IADTabpanelIs tab panel have been activated- Specified by:
isActivatedin interfaceIADTabpanel- Returns:
- true if the tab panel have been activated
-
setDetailPaneMode
public void setDetailPaneMode(boolean detailMode) Description copied from interface:IADTabpanelTurn on/off detail mode, i.e whether tab panel is currently a header or detail tab of the window.- Specified by:
setDetailPaneModein interfaceIADTabpanel
-
isDetailPaneMode
public boolean isDetailPaneMode()Description copied from interface:IADTabpanelIs tab panel in detail pane mode- Specified by:
isDetailPaneModein interfaceIADTabpanel- Returns:
- true if the panel is in detail mode (i.e a tab in DetailPane)
-
getGridView
Description copied from interface:IADTabpanelGet GridView component- Specified by:
getGridViewin interfaceIADTabpanel- Returns:
GridViewinstance
-
needSave
public boolean needSave(boolean rowChange, boolean onlyRealChange) Description copied from interface:IADTabpanel- Specified by:
needSavein interfaceIADTabpanel- Returns:
- true if there are pending changes
-
dataSave
public boolean dataSave(boolean onSaveEvent) Description copied from interface:IADTabpanelSave changes.
CallGridTab.dataSave(boolean)- Specified by:
dataSavein interfaceIADTabpanel- Returns:
- true if the save operation completed successfully
-
setTabNo
public void setTabNo(int tabNo) Description copied from interface:IADTabpanelSet tab number/sequence within an AD_Window- Specified by:
setTabNoin interfaceIADTabpanel
-
getTabNo
public int getTabNo()Description copied from interface:IADTabpanelGet tab no- Specified by:
getTabNoin interfaceIADTabpanel- Returns:
- tab no ( ad_tab.tabno )
-
setDetailPane
Description copied from interface:IADTabpanelSet theDetailPanepart that own this IADTabpanel instance- Specified by:
setDetailPanein interfaceIADTabpanel
-
getDetailPane
Description copied from interface:IADTabpanelGet parent detail pane- Specified by:
getDetailPanein interfaceIADTabpanel- Returns:
- the
DetailPanepart that own this IADTabpanel instance
-
resetDetailForNewParentRecord
public void resetDetailForNewParentRecord()Description copied from interface:IADTabpanelReset detail data grid when current record of parent tab is new and not saved yet.
CallGridTab.resetDetailForNewParentRecord()- Specified by:
resetDetailForNewParentRecordin interfaceIADTabpanel
-
getTreePanel
Description copied from interface:IADTabpanelGet tree panel component- Specified by:
getTreePanelin interfaceIADTabpanel- Returns:
ADTreePanelinstance
-
isEnableQuickFormButton
public boolean isEnableQuickFormButton()Description copied from interface:IADTabpanelIs quick form enabled- Specified by:
isEnableQuickFormButtonin interfaceIADTabpanel- Returns:
- true if Quick Form Button is Enabled
-
getToolbarButtons
Description copied from interface:IADTabpanelGet toolbar buttons- Specified by:
getToolbarButtonsin interfaceIADTabpanel- Returns:
- List of toolbar buttons
-
isEnableCustomizeButton
public boolean isEnableCustomizeButton()Description copied from interface:IADTabpanelIs customize grid button enable- Specified by:
isEnableCustomizeButtonin interfaceIADTabpanel- Returns:
- true if customize grid button is enabled
-
isEnableProcessButton
public boolean isEnableProcessButton()Description copied from interface:IADTabpanelIs process button enable- Specified by:
isEnableProcessButtonin interfaceIADTabpanel- Returns:
- true if process Button is Enabled
-
updateToolbar
Description copied from interface:IADTabpanelUpdate ADWindowToolbar buttons state- Specified by:
updateToolbarin interfaceIADTabpanel- Parameters:
toolbar- -ADWindowToolbar
-
updateDetailToolbar
public void updateDetailToolbar(org.zkoss.zul.Toolbar toolbar) Description copied from interface:IADTabpanelUpdateDetailPanetoolbar buttons state- Specified by:
updateDetailToolbarin interfaceIADTabpanel- Parameters:
toolbar- -Toolbar
-