Package org.adempiere.webui.panel
Class InfoPanel
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
org.adempiere.webui.component.Window
org.adempiere.webui.panel.InfoPanel
- All Implemented Interfaces:
Serializable
,Cloneable
,WTableModelListener
,ISupportMask
,IHelpContext
,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
,org.zkoss.zul.ext.Framable
,org.zkoss.zul.ext.Sortable<Object>
- Direct Known Subclasses:
InfoAssetPanel
,InfoAssignmentPanel
,InfoBPartnerPanel
,InfoCashLinePanel
,InfoGeneralPanel
,InfoInOutPanel
,InfoInvoicePanel
,InfoOrderPanel
,InfoPaymentPanel
,InfoProductPanel
,InfoWindow
public abstract class InfoPanel
extends Window
implements org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, WTableModelListener, org.zkoss.zul.ext.Sortable<Object>, IHelpContext
Search dialog that works in two mode.
Lookup mode: Search and return selection to lookup field.
Window mode: Search and view search results. Optional support for execution of process.
Lookup mode: Search and return selection to lookup field.
Window mode: Search and view search results. Optional support for execution of process.
- Author:
- Sendy Yagambrum, Elaine
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zul.Window
org.zkoss.zul.Window.Mode
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 TypeFieldDescriptionprotected static final String
protected String
column name for auto complete callprotected Button
IDEMPIERE-1334 button and combobox when layout process button as dropdown listprotected Button
protected Combobox
protected static final String
AD_InfoColumn_ID:Index Column Sequence
Store index of infoColumn that have been added.Index increase from 0.protected ConfirmPanel
protected WListbox
Column:WEditorprotected int
protected boolean
protected boolean
flag detect exists info processprotected int
Number of index column that have been added tocolumnDataIndex
.protected int
index ofkeyColumnOfView
in data model, set when prepare listboxprotected int
protected static final String
protected List<MInfoProcess>
Info process with style = buttonprotected List<MInfoProcess>
Info process with style = drop down listprotected MInfoProcess[]
Info processes of this infoWindowprotected List<MInfoProcess>
Info process with style = menuprotected MInfoWindow
protected boolean
true for auto complete call from lookup fieldprotected Boolean
protected boolean
protected boolean
protected boolean
protected boolean
After loading of first record, set this to false.
When need to updatecolumnDataIndex
, set this to true.protected boolean
If false, use saved where clause.protected boolean
When re-query but don't want to clear selected record (example after run process), set this flag to true to run sync selected record.protected MInfoColumn
MInfoColumn with isKey = true.protected CLogger
LoggerBefore the start of reading of a row, reset this list.protected int
protected GridField
protected int
AD_InfoWindow_IDprotected boolean
true for lookup modeContains the keys of the selected rows in the order of selectionprotected int
Number of selected rowsprotected String
Count SQL Statementprotected String
Main SQL Statementprotected String
Order By ClauseKeyNamePair/ValueNamePair:[Column:Value]protected Collection<NamePair>
saved selected id and viewIDprotected int
protected static final String
protected static final String
protected static final String
protected String
Key Column Nameprotected ColumnInfo[]
Layout ofcontentPanel
protected boolean
Loading success indicatorprotected boolean
Enable more than one selectionprotected String
Table Nameprotected String
Initial WHERE Clauseprotected int
Lookup mode: parent window number.protected int
protected int
protected org.zkoss.zul.Paging
Parameter Name:Value Values that will be put into the context on re-querysaved value of previous query parametersprotected String
saved where clause of previous queryprotected static final String
protected int
protected String
Value of Key Column:Values of Row.
Store selected rows.
If there's no key column of view, use value ofp_keyColumn
.
Zk6.x listview deosn't send event when user click header checkbox to select all rows, so we can't manage selectedRecord all the time.protected InfoRelatedVO[]
protected static final String
protected static final String
protected String
sql column name of infocolumn (can be alias)protected StatusBarPanel
protected boolean
static final int
static final int
Fields inherited from class org.adempiere.webui.component.Window
INSERT_END, INSERT_NEXT, INSERT_POSITION_KEY, MODE_EMBEDDED, MODE_HIGHLIGHTED, MODE_KEY, MODE_MODAL, MODE_OVERLAPPED, MODE_POPUP, REPLACE, showMaskWrapper
Fields inherited from class org.zkoss.zul.Window
EMBEDDED, HIGHLIGHTED, MODAL, OVERLAPPED, POPUP
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
Fields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAG
-
Constructor Summary
ModifierConstructorDescriptionprotected
InfoPanel
(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause) protected
InfoPanel
(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup) protected
InfoPanel
(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, int ADInfoWindowID) protected
InfoPanel
(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, int ADInfoWindowID, String queryValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addValueChangeListener
(ValueChangeListener listener) protected void
AppendkeyColumnOfView
to data.protected void
Append id column in related info list to data.protected void
Append viewID column in infoProcessList to data.protected void
appendInfoColumnData
(ResultSet rs, List<Object> data, IInfoColumn[] listModelHasInfoColumn, List<Integer> listReadedColumn) Append value of infoColumn in listModelHaveInfoColumn to data.protected void
auto hide empty columnsprotected void
Evaluate display logic of processes.protected String
buildDataSQL
(int start, int end) build sql clause with pagingprotected void
Set sort direction indicatorstatic InfoPanel
create
(int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, String whereClause) void
createT_Selection_InfoWindow
(int AD_PInstance_ID) Insert selected rows to T_Selection_InfoWindowprotected void
Show Customize dialogvoid
dispose
(boolean ok) Dispose and save Selectionprotected void
enable all control button or disable all depends on whether there are selected records.protected void
enableButtons
(boolean enable) enable or disable all control button Enable OK, History, Zoom if row/s selected --- Changes: Changed the logic for accommodating multiple selection author ashleyprotected void
Execute Queryvoid
fireValueChange
(ValueChangeEvent event) Fire ValueChangeEvent event.protected int
getAD_Window_ID
(String tableName, boolean isSOTrx) Get Zoom WindowGet alias of the table, or the table nameprotected int
protected int
getColumnHeader
(ColumnInfo[] p_layout) protected Object
getColumnValue
(int rowIndex) Get keyView value at rowIndex.
Exception is raise if value is null.String[]
field call this info panel as search editor null in case info window open in stand-alone window (from menu, fav,...)protected int
get column index of keyViewprotected int
getInfoColumnIDFromProcess
(int processId) Get InfoColumnID of infoProcessprotected Integer
getIntSelectedRowKey
(int tableId) Get the integer key of currently selected rowprotected String
Get Key Column Nameprotected AdempiereException
Get last selected rowprotected int
getOverIntValue
(long value) When calculating value at bound of integer datatype, sometime value will overflow.protected int
getOverIntValue
(long value, int extra) seegetOverIntValue(long)
. when value >= max_value, set it near or equal to max_value.int
int
getRowKeyAt
(int row) getSaveKeys
(int infoColumnId) Add view id column (infoColumnId) tom_viewIDMap
.protected String
Get a comma-separated string of selected IDsGet (first) selected KeyObject[]
Get selected KeysDeprecated.use getSaveKeysUpdaterecordSelectedData
protected <T extends Serializable>
TGet the key of currently selected rowprotected <T extends Serializable>
List<T>Get the keys of selected rowsGet where clause for (first) selected keygetSortDirection
(Comparator<Object> cmpr) protected abstract String
Get dynamic WHERE part of SQL.
When override this method, please take isQueryByUser and prevWhereClause into consideration.Widget support Depending on Window/Tab returns widget lines infogetSubList
(int fromIndex, int toIndex, List<Object> line) fromIndex and toIndex is calculate base on result fromtestCount()
.protected String
Get Table name Synonymprotected String
build order clause of current sort column, and save it to m_sqlUserOrderprotected String
getUserOrderClause
(int col) Build order clause of given column index.int
protected boolean
Has Customize dialog (default false).protected boolean
Has History (default false).protected boolean
hasNew()
Support create new record (default false)protected boolean
protected boolean
hasZoom()
Has Zoom support (default false)protected void
Call after loading of parameter panel to set initial value.protected void
add paging component for list boxprotected boolean
boolean
Is cancelled?boolean
protected boolean
isIDColumn
(Object keyData) callisIDColumn(Object, boolean)
without null checkprotected boolean
isIDColumn
(Object keyData, boolean isCheckNull) Check type of object is IDColumnprotected boolean
boolean
isLookup()
protected boolean
need override at infoWindow to check isDisplayprotected boolean
boolean
loadedOK()
Loaded correctlyprotected void
query ADInfoWindow from ADInfoWindowIDprotected void
Handle user click on new record button.protected void
onCancel()
handle cancel eventprotected void
handle double click on row eventvoid
onEvent
(org.zkoss.zk.ui.event.Event event) protected void
onOk()
handle ok eventvoid
onPageAttached
(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage) void
onPageDetached
(org.zkoss.zk.ui.Page page) void
onQueryCallback
(org.zkoss.zk.ui.event.Event event) handle echo from query eventboolean
onRestoreSelectedItemIndexInPage
(Object keyViewValue, int rowIndex, Object row) Hook to intercept 'restore selection' actionsvoid
Call query when user click to query button enter in parameter fieldprotected void
parse query value from calling input elementprotected void
prepareTable
(ColumnInfo[] layout, String from, String where, String orderBy) set up list box and construct sql clauseprotected void
preRunProcess
(Integer processId) Before running of processprotected void
render list box itemsprotected void
Reset parameter to default value or to empty value.protected void
go through all data record, in case key value is inrecordSelectedData
, mark it as selected recordprotected void
runProcess
(Object processIdObj) Run a process.
Before start process, save id of record selected.protected void
saveResultSelection
(int infoColumnId) Save selected rows tom_values
protected void
Save Selection - Called by disposeprotected void
Save Selection Details.void
scroll selected row into view (i.e make sure it is visible)void
setCloseAfterExecutionOfProcess
(boolean closeAfterExecutionOfProcess) Set whether dialog should auto close after successful execution of processprotected void
setContext
(String columnName, Object value) Set contextvoid
setFixedQueryTimeout
(int timeout) set fixed query timeout value, overwrite the value from sysconfigvoid
setGridfield
(GridField m_gridfield) void
setMultipleSelection
(boolean multipleSelection) protected abstract void
setParameters
(PreparedStatement pstmt, boolean forCount) Set Parameters for Query.void
setStatusDB
(String text) Set status text for DBvoid
setStatusLine
(String text, boolean error) Set Status Linevoid
Set status text for selected rowsprotected void
Show history dialogstatic void
Show panel based on tablename (non modal and not lookup)void
sort
(Comparator<Object> cmpr, boolean ascending) protected void
Maintain selected record after re-query (for example after success run of a process).void
tableChanged
(WTableModelEvent event) Notify listeners the exact range of cells, rows, or columns that have changed.protected boolean
Test Row Countprotected void
updateContext
(boolean checkQueryCriteria) Put values from the selected row into the contextprotected void
Get all selected record of current page and update torecordSelectedData
.
Remove unselected record and add new selected record.
We maintain value of key, and extra value append byappendInfoColumnData(ResultSet, List, IInfoColumn[], List)
protected void
Update row selection orderprotected void
updateStatusBar
(int no) update info window status textprotected void
Update related info when selection incontentPanel
change.protected void
updateSubcontent
(int targetRow) Update related info for a specific row.protected void
After query from database, validate paging (when paging is dynamic, ie isLoadPageNumber()==false)
If end page include in cache, calculate total record read.protected void
column index of grid isn't fix, it can change by display logic of column each time after loading of dataInfoWindow.prepareTable(ColumnInfo[], String, String, String)
, so need to validate it by comparing the sql of current sort columnboolean
validate parameter before run queryvoid
zoom()
zoom to recordMethods inherited from class org.adempiere.webui.component.Window
dispose, getMaskComponent, getMaskObj, getModeAttribute, hideMask, isFireWindowCloseEventOnDetach, setFireWindowCloseEventOnDetach, showMask
Methods inherited from class org.zkoss.zul.Window
beforeChildAdded, clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getDefaultActionOnShow, getMinheight, getMinwidth, getMode, getModeType, getPosition, getTitle, getZclass, inEmbedded, inHighlighted, inModal, inOverlapped, inPopup, insertBefore, isClosable, isCollapsible, isMaximizable, isMaximized, isMinimizable, isMinimized, isShadow, isSizable, onChildRemoved, onClose, onModal, renderProperties, service, setBorder, setBorder, setClosable, setContentSclass, setContentStyle, setDefaultActionOnShow, setDraggable, setMaximizable, setMaximized, setMinheight, setMinimizable, setMinimized, setMinwidth, setMode, setMode, setMode, setPosition, setShadow, setSizable, setTitle, setTopmost, setVisible
Methods inherited from class org.zkoss.zul.impl.XulElement
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, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, 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, 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, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, 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, 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.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
Methods inherited from interface org.zkoss.zul.ext.Sortable
sort
-
Field Details
-
ON_USER_QUERY_ATTR
- See Also:
-
INFO_QUERY_TIME_OUT_ERROR
- See Also:
-
COLUMN_VISIBLE_ORIGINAL
- See Also:
-
ROW_CTX_VARIABLE_PREFIX
- See Also:
-
ROW_ID_CTX_VARIABLE_NAME
- See Also:
-
btProcessList
-
editorMap
Column:WEditor -
PROCESS_ID_KEY
- See Also:
-
ON_RUN_PROCESS
- See Also:
-
ON_SELECT_ALL_RECORDS
- See Also:
-
ATT_INFO_PROCESS_KEY
- See Also:
-
pageSize
protected int pageSize -
m_values
KeyNamePair/ValueNamePair:[Column:Value] -
isIgnoreCacheAll
protected boolean isIgnoreCacheAll -
numPagePreLoad
protected int numPagePreLoad -
extra_max_row
protected int extra_max_row -
keyColumnOfView
MInfoColumn with isKey = true. In case no column has isKey = true, keyColumnOfView will be null and we usep_keyColumn
-
indexKeyOfView
protected int indexKeyOfViewindex ofkeyColumnOfView
in data model, set when prepare listbox -
isIDColumnKeyOfView
protected boolean isIDColumnKeyOfView -
hasRightQuickEntry
protected boolean hasRightQuickEntry -
isHasNextPage
protected boolean isHasNextPage -
recordSelectedData
Value of Key Column:Values of Row.
Store selected rows.
If there's no key column of view, use value ofp_keyColumn
.
Zk6.x listview deosn't send event when user click header checkbox to select all rows, so we can't manage selectedRecord all the time.
Each time change page, we will update this list with current selected records of current page
by calling functionupdateListSelected()
. When move to zk7, enough to just handle onclick only.
Because of the issue above, don't use recordSelectedData directly, callgetSelectedRowInfo()
instead. -
isRequeryByRunSuccessProcess
protected boolean isRequeryByRunSuccessProcessWhen re-query but don't want to clear selected record (example after run process), set this flag to true to run sync selected record. See alsosyncSelectedAfterRequery()
-
m_lookup
protected boolean m_lookuptrue for lookup mode -
m_infoWindowID
protected int m_infoWindowIDAD_InfoWindow_ID -
confirmPanel
-
p_WindowNo
protected int p_WindowNoLookup mode: parent window number. Non lookup mode: register desktop tab number for this window -
p_tableName
Table Name -
p_keyColumn
Key Column Name -
p_multipleSelection
protected boolean p_multipleSelectionEnable more than one selection -
p_whereClause
Initial WHERE Clause -
statusBar
-
p_layout
Layout ofcontentPanel
-
m_sqlMain
Main SQL Statement -
m_sqlCount
Count SQL Statement -
m_sqlOrder
Order By Clause -
indexOrderColumn
protected int indexOrderColumn -
sqlOrderColumn
sql column name of infocolumn (can be alias) -
isColumnSortAscending
-
p_loadedOK
protected boolean p_loadedOKLoading success indicator -
infoWindow
-
log
Logger -
contentPanel
-
paging
protected org.zkoss.zul.Paging paging -
pageNo
protected int pageNo -
m_count
protected int m_count -
m_gridfield
-
isQueryByUser
protected boolean isQueryByUserIf false, use saved where clause. IDEMPIERE-1979 -
isAutoComplete
protected boolean isAutoCompletetrue for auto complete call from lookup field -
queryTimeout
protected int queryTimeout -
useQueryTimeoutFromSysConfig
protected boolean useQueryTimeoutFromSysConfig -
autoCompleteSearchColumn
column name for auto complete call -
queryValue
-
prevWhereClause
saved where clause of previous query -
prevParameterValues
saved value of previous query parameters -
prevQueryOperators
-
prevRefParmeterEditor
-
infoProcessList
Info processes of this infoWindow -
haveProcess
protected boolean haveProcessflag detect exists info process -
infoProcessBtList
Info process with style = button -
infoProcessDropList
Info process with style = drop down list -
infoProcessMenuList
Info process with style = menu -
m_viewIDMap
saved selected id and viewID -
columnDataIndex
AD_InfoColumn_ID:Index Column Sequence
Store index of infoColumn that have been added.Index increase from 0. -
isMustUpdateColumnIndex
protected boolean isMustUpdateColumnIndexAfter loading of first record, set this to false.
When need to updatecolumnDataIndex
, set this to true. -
indexColumnCount
protected int indexColumnCountNumber of index column that have been added tocolumnDataIndex
. -
lsReadedColumn
Before the start of reading of a row, reset this list.
After reading of each column, store id of infoColumn to this list to prevent duplicate. -
btCbbProcess
IDEMPIERE-1334 button and combobox when layout process button as dropdown list -
cbbProcess
-
btMenuProcess
-
m_rowSelectionOrder
Contains the keys of the selected rows in the order of selection -
m_selectedCount
protected int m_selectedCountNumber of selected rows -
paraCtxValues
Parameter Name:Value Values that will be put into the context on re-query -
VK_ENTER
public static final int VK_ENTER- See Also:
-
VK_ESCAPE
public static final int VK_ESCAPE- See Also:
-
-
Constructor Details
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause) - Parameters:
WindowNo
- WindowNotableName
- tableNamekeyColumn
- keyColumnmultipleSelection
-whereClause
- whereClause
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup) - Parameters:
WindowNo
-tableName
-keyColumn
-multipleSelection
-whereClause
-lookup
-
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, int ADInfoWindowID) - Parameters:
WindowNo
-tableName
-keyColumn
-multipleSelection
-whereClause
-lookup
-ADInfoWindowID
-
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, int ADInfoWindowID, String queryValue) - Parameters:
WindowNo
- WindowNotableName
- tableNamekeyColumn
- keyColumnmultipleSelection
-whereClause
- whereClauselookup
-ADInfoWindowID
-queryValue
-
-
-
Method Details
-
create
public static InfoPanel create(int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, String whereClause) - Parameters:
WindowNo
-tableName
-keyColumn
-value
-multiSelection
-whereClause
-- Returns:
InfoPanel
-
showPanel
Show panel based on tablename (non modal and not lookup)- Parameters:
tableName
-
-
parseQueryValue
protected void parseQueryValue()parse query value from calling input element -
setFixedQueryTimeout
public void setFixedQueryTimeout(int timeout) set fixed query timeout value, overwrite the value from sysconfig- Parameters:
timeout
-
-
loadedOK
public boolean loadedOK()Loaded correctly- Returns:
- true if loaded OK
-
setStatusLine
Set Status Line- Parameters:
text
- texterror
- error
-
setStatusDB
Set status text for DB- Parameters:
text
- text
-
setStatusSelected
public void setStatusSelected()Set status text for selected rows -
prepareTable
set up list box and construct sql clause- Parameters:
layout
-from
-where
-orderBy
-
-
isLoadPageNumber
protected boolean isLoadPageNumber()- Returns:
- true if number of page will be determined through record count.
-
executeQuery
protected void executeQuery()Execute Query -
appendDataForViewID
protected void appendDataForViewID(ResultSet rs, List<Object> data, List<Integer> listReadedColumn) throws SQLException Append viewID column in infoProcessList to data.
When overridereadData(ResultSet)
, should include call to this method. IDEMPIERE-1970- Parameters:
rs
- result set to read datadata
- data line to appendlistReadedColumn
- list of columns appended- Throws:
SQLException
-
appendDataForParentLink
protected void appendDataForParentLink(ResultSet rs, List<Object> data, List<Integer> listReadedColumn) throws SQLException Append id column in related info list to data.
When overridereadData(ResultSet)
, should include call to this method. IDEMPIERE-2152- Parameters:
rs
-data
-listReadedColumn
-- Throws:
SQLException
-
appendDataForKeyView
protected void appendDataForKeyView(ResultSet rs, List<Object> data, List<Integer> listReadedColumn) throws SQLException AppendkeyColumnOfView
to data.
When overridereadData(ResultSet)
, should include call to this method. IDEMPIERE-1970- Parameters:
rs
- record set to read datadata
- data line to appendlistReadedColumn
- list column is appended- Throws:
SQLException
-
appendInfoColumnData
protected void appendInfoColumnData(ResultSet rs, List<Object> data, IInfoColumn[] listModelHasInfoColumn, List<Integer> listReadedColumn) throws SQLException Append value of infoColumn in listModelHaveInfoColumn to data.- Parameters:
rs
- record set to read datadata
- data line to appendlistModelHasInfoColumn
-listReadedColumn
- list of columns appended- Throws:
SQLException
-
renderItems
protected void renderItems()render list box items -
autoHideEmptyColumns
protected void autoHideEmptyColumns()auto hide empty columns -
isAutoHideEmptyColumns
protected boolean isAutoHideEmptyColumns()- Returns:
- true if info window should auto hide empty columns
-
updateStatusBar
protected void updateStatusBar(int no) update info window status text- Parameters:
no
-
-
validateEndPage
protected void validateEndPage()After query from database, validate paging (when paging is dynamic, ie isLoadPageNumber()==false)
If end page include in cache, calculate total record read.
If current page is out of cache, process query count to detect end page. -
getSubList
fromIndex and toIndex is calculate base on result fromtestCount()
.
For example after testCount, the calculated number of page is 6 page.
When user navigate to page 4. something change in database and we just get 5 page with current query parameter.
So when user navigate to page 6. user will face with index issue (out of index or start index > end index).
This function include fix for it.- Parameters:
fromIndex
-toIndex
-line
-- Returns:
- sub list from line
-
getOverIntValue
protected int getOverIntValue(long value) When calculating value at bound of integer datatype, sometime value will overflow. This function calculate with higher data type to avoid the overflow issue.- Parameters:
value
-- Returns:
- int
-
getOverIntValue
protected int getOverIntValue(long value, int extra) seegetOverIntValue(long)
. when value >= max_value, set it near or equal to max_value.- Parameters:
value
-extra
- extra value to minus from max_value- Returns:
- int
-
buildDataSQL
build sql clause with paging- Parameters:
start
-end
-- Returns:
- sql clause
-
validateOrderIndex
protected void validateOrderIndex()column index of grid isn't fix, it can change by display logic of column each time after loading of dataInfoWindow.prepareTable(ColumnInfo[], String, String, String)
, so need to validate it by comparing the sql of current sort column -
getUserOrderClause
build order clause of current sort column, and save it to m_sqlUserOrder- Returns:
- order clause
-
getUserOrderClause
Build order clause of given column index.
If call init list will raise NPE.- Parameters:
col
-- Returns:
- order clause
-
getAlias
Get alias of the table, or the table name- Returns:
- String alias
-
insertPagingComponent
protected void insertPagingComponent()add paging component for list box -
getColumnHeader
- Parameters:
p_layout
-- Returns:
- column headers
-
testCount
protected boolean testCount()Test Row Count- Returns:
- true if display
-
saveSelection
protected void saveSelection()Save Selection - Called by dispose -
getSelectedRowKey
Get the key of currently selected row- Returns:
- selected key
-
getIntSelectedRowKey
Get the integer key of currently selected row- Parameters:
tableId
-- Returns:
- selected key
-
getSelectedRowKeys
Get the keys of selected rows- Returns:
- selected IDs or UUIDs
-
getSelectedKeysCollection
Deprecated.use getSaveKeysGet selected Keys as Collection- Returns:
- selected keys (Integers)
-
getSaveKeys
Add view id column (infoColumnId) tom_viewIDMap
.- Parameters:
infoColumnId
- view id column
-
isNeedAppendKeyViewData
protected boolean isNeedAppendKeyViewData()need override at infoWindow to check isDisplay- Returns:
- true if need to append
keyColumnOfView
tocolumnDataIndex
-
isIDColumn
Check type of object is IDColumn- Parameters:
keyData
-isCheckNull
- when true, raise exception when data is null- Returns:
- true if keyData is instanceof IDColumn
-
isIDColumn
callisIDColumn(Object, boolean)
without null check- Parameters:
keyData
-- Returns:
- true if keyData is instanceof IDColumn
-
updateListSelected
protected void updateListSelected()Get all selected record of current page and update torecordSelectedData
.
Remove unselected record and add new selected record.
We maintain value of key, and extra value append byappendInfoColumnData(ResultSet, List, IInfoColumn[], List)
-
getIndexKeyColumnOfView
protected int getIndexKeyColumnOfView()get column index of keyView- Returns:
- index of key column
-
restoreSelectedInPage
protected void restoreSelectedInPage()go through all data record, in case key value is inrecordSelectedData
, mark it as selected record -
onRestoreSelectedItemIndexInPage
Hook to intercept 'restore selection' actions- Parameters:
keyViewValue
- row view keyrowIndex
- row indexrow
- row- Returns:
- false to skip restore selection
-
getKeyNullException
-
getColumnValue
Get keyView value at rowIndex.
Exception is raise if value is null.- Parameters:
rowIndex
-- Returns:
- value of key column
-
syncSelectedAfterRequery
protected void syncSelectedAfterRequery()Maintain selected record after re-query (for example after success run of a process).
We must sync selected row, because some selected row maybe missing after re-query (change by process and no longer match with current query). TODO:rewrite, current code just reset isRequeryByRunSuccessProcess flag and didn't do anything else. -
getSelectedRowInfo
UpdaterecordSelectedData
- Returns:
recordSelectedData
after update
-
getSelectedKeys
Get selected Keys- Returns:
- selected keys (Integers)
-
getSelectedKey
Get (first) selected Key- Returns:
- selected key
-
isCancelled
public boolean isCancelled()Is cancelled? - if pressed Cancel = true - if pressed OK or window closed = false- Returns:
- true if cancelled
-
getSelectedSQL
Get where clause for (first) selected key- Returns:
- WHERE Clause
-
loadInfoWindowData
protected void loadInfoWindowData()query ADInfoWindow from ADInfoWindowID -
getTableName
Get Table name Synonym- Returns:
- table name
-
getKeyColumn
Get Key Column Name- Returns:
- column name
-
getEvents
- Returns:
- list of events
-
enableButtons
protected void enableButtons()enable all control button or disable all depends on whether there are selected records. -
enableButtons
protected void enableButtons(boolean enable) enable or disable all control button Enable OK, History, Zoom if row/s selected --- Changes: Changed the logic for accommodating multiple selection author ashley -
getSQLWhere
Get dynamic WHERE part of SQL.
When override this method, please take isQueryByUser and prevWhereClause into consideration.- Returns:
- WHERE clause
-
setParameters
protected abstract void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException Set Parameters for Query.
When override this method, please take isQueryByUser and prevWhereClause into consideration.- Parameters:
pstmt
- statementforCount
- for counting records- Throws:
SQLException
-
showHistory
protected void showHistory()Show history dialog -
hasHistory
protected boolean hasHistory()Has History (default false). Override this andshowHistory()
method to add history dialog support.- Returns:
- true if it has history (default false)
-
hasProcess
protected boolean hasProcess()- Returns:
- true if support running of process.
-
customize
protected void customize()Show Customize dialog -
hasCustomize
protected boolean hasCustomize()Has Customize dialog (default false). Override this andcustomize()
method to add customize dialog support.- Returns:
- true if it has customize (default false)
-
hasZoom
protected boolean hasZoom()Has Zoom support (default false)- Returns:
- true if it has zoom support (default false)
-
hasNew
protected boolean hasNew()Support create new record (default false)- Returns:
- true if support create new record
-
saveSelectionDetail
protected void saveSelectionDetail()Save Selection Details.
This method is call when user close an info window.
By default, infoWindow will set value of all column of current selected record to environment context withEnv.TAB_INFO
.
Sub class can override this method to do more. -
getAD_Window_ID
Get Zoom Window- Parameters:
tableName
- table nameisSOTrx
- sales trx- Returns:
- AD_Window_ID
-
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>
-
onCancel
protected void onCancel()handle cancel event -
onUserQuery
public void onUserQuery()Call query when user click to query button enter in parameter field -
validateParameters
public boolean validateParameters()validate parameter before run query- Returns:
- true if parameters pass validation
-
initParameters
protected void initParameters()Call after loading of parameter panel to set initial value. Can call to reset parameters. -
updateSubcontent
protected void updateSubcontent()Update related info when selection incontentPanel
change. -
updateSubcontent
protected void updateSubcontent(int targetRow) Update related info for a specific row. If targetRow < 0, update using selected row.- Parameters:
targetRow
-
-
resetParameters
protected void resetParameters()Reset parameter to default value or to empty value. -
preRunProcess
Before running of process- Parameters:
processId
-
-
runProcess
Run a process.
Before start process, save id of record selected.
After run of process, show process message report result.- Parameters:
processIdObj
-
-
saveResultSelection
protected void saveResultSelection(int infoColumnId) Save selected rows tom_values
- Parameters:
infoColumnId
- AD_InfoProcess.AD_InfoColumn_ID. Use as key column if > 0
-
createT_Selection_InfoWindow
public void createT_Selection_InfoWindow(int AD_PInstance_ID) Insert selected rows to T_Selection_InfoWindow- Parameters:
AD_PInstance_ID
-
-
getInfoColumnIDFromProcess
protected int getInfoColumnIDFromProcess(int processId) Get InfoColumnID of infoProcess- Parameters:
processId
-- Returns:
- AD_InfoColumn_ID, -1 if processId not in
infoProcessList
-
correctHeaderOrderIndicator
protected void correctHeaderOrderIndicator()Set sort direction indicator -
onQueryCallback
public void onQueryCallback(org.zkoss.zk.ui.event.Event event) handle echo from query event- Parameters:
event
- null to indicate reset instead of echo from query event
-
bindInfoProcess
protected void bindInfoProcess()Evaluate display logic of processes. Implemented by sub class. -
onOk
protected void onOk()handle ok event -
onDoubleClick
protected void onDoubleClick()handle double click on row event -
tableChanged
Description copied from interface:WTableModelListener
Notify listeners the exact range of cells, rows, or columns that have changed.- Specified by:
tableChanged
in interfaceWTableModelListener
- Parameters:
event
- table model event
-
zoom
public void zoom()zoom to record -
newRecordAction
protected void newRecordAction()Handle user click on new record button. -
addValueChangeListener
- Parameters:
listener
-
-
fireValueChange
Fire ValueChangeEvent event.- Parameters:
event
-
-
dispose
public void dispose(boolean ok) Dispose and save Selection- Parameters:
ok
- true if OK pressed
-
sort
- Specified by:
sort
in interfaceorg.zkoss.zul.ext.Sortable<Object>
- Parameters:
cmpr
-WListItemRenderer.ColumnComparator
ascending
-
-
isLookup
public boolean isLookup()- Returns:
- true if this is a lookup dialog
-
scrollToSelectedRow
public void scrollToSelectedRow()scroll selected row into view (i.e make sure it is visible) -
getSortDirection
- Specified by:
getSortDirection
in interfaceorg.zkoss.zul.ext.Sortable<Object>
-
getWindowNo
public int getWindowNo()- Returns:
- window no
-
getRowCount
public int getRowCount()- Returns:
- row count
-
getFirstRowKey
- Returns:
- first row key/id
-
getRowKeyAt
- Parameters:
row
-- Returns:
- row key/id
-
getCacheStart
protected int getCacheStart()- Returns:
- the cacheStart
-
getCacheEnd
protected int getCacheEnd()- Returns:
- the cacheEnd
-
isUseDatabasePaging
protected boolean isUseDatabasePaging()- Returns:
- true if using database paging feature
-
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 classWindow
-
getGridfield
field call this info panel as search editor null in case info window open in stand-alone window (from menu, fav,...)- Returns:
GridField
-
setGridfield
- Parameters:
m_gridfield
-
-
getPageSize
public int getPageSize()- Returns:
- page size (number of rows per page)
-
isCloseAfterExecutionOfProcess
public boolean isCloseAfterExecutionOfProcess()- Returns:
- true if dialog should auto close after successful execution of process
-
setCloseAfterExecutionOfProcess
public void setCloseAfterExecutionOfProcess(boolean closeAfterExecutionOfProcess) Set whether dialog should auto close after successful execution of process- Parameters:
closeAfterExecutionOfProcess
-
-
setMultipleSelection
public void setMultipleSelection(boolean multipleSelection) - Parameters:
multipleSelection
-
-
getStatusLinesWidget
Widget support Depending on Window/Tab returns widget lines info- Returns:
- info
-
updateRowSelectionOrder
protected void updateRowSelectionOrder()Update row selection order -
updateContext
protected void updateContext(boolean checkQueryCriteria) Put values from the selected row into the context -
setContext
Set context- Parameters:
columnName
-value
-
-
getSelectedIDsForCtx
Get a comma-separated string of selected IDs- Returns:
- String ctx value
-
getLastSelectedRow
Get last selected row- Returns:
- List
-