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 Information and return selection - Base Class. Based on Info written by Jorg Janke- Version:
- Info.java Adempiere Swing UI 3.4.1
- Author:
- Sendy Yagambrum Zk Port, Elaine
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
ATT_INFO_PROCESS_KEY
protected String
autoCompleteSearchColumn
protected Button
btCbbProcess
IDEMPIERE-1334 button and combobox when layout process button as dropdow listprotected Button
btMenuProcess
protected List<Button>
btProcessList
protected Combobox
cbbProcess
protected static String
COLUMN_VISIBLE_ORIGINAL
protected Map<Integer,Integer>
columnDataIndex
store index of infoColumn have data append. each infoColumn just append only one time.protected ConfirmPanel
confirmPanel
protected WListbox
contentPanel
protected Map<String,WEditor>
editorMap
protected int
extra_max_row
protected boolean
hasRightQuickEntry
protected boolean
haveProcess
flag detect exists info processprotected int
indexColumnCount
When start update index of column data append to end of listcolumnDataIndex
, reset it to 0, each read data for new append column, increase it up 1protected int
indexKeyOfView
index ofkeyColumnOfView
in data model, set when prepare listboxprotected int
indexOrderColumn
protected static String
INFO_QUERY_TIME_OUT_ERROR
protected List<MInfoProcess>
infoProcessBtList
Info process have style is buttonprotected List<MInfoProcess>
infoProcessDropList
Info process have style is drop down listprotected MInfoProcess[]
infoProcessList
All info process of this infoWindowprotected List<MInfoProcess>
infoProcessMenuList
Info process have style is menuprotected MInfoWindow
infoWindow
protected boolean
isAutoComplete
protected Boolean
isColumnSortAscending
protected boolean
isHasNextPage
protected boolean
isIDColumnKeyOfView
protected boolean
isIgnoreCacheAll
protected boolean
isMustUpdateColumnIndex
after load first record, set it to false.protected boolean
isQueryByUser
false, use saved where clause IDEMPIERE-1979protected boolean
isRequeryByRunSuccessProcess
when requery but don't clear selected record (example after run process) set flag to true to run sync selected record, alsosyncSelectedAfterRequery()
protected MInfoColumn
keyColumnOfView
MInfoColumn has isKey = true, play as key column in case non column has isKey = true, this column is null and we usep_keyColumn
protected CLogger
log
Loggerprotected List<Integer>
lsReadedColumn
to prevent append duplicate data, when begin read each record reset this list, when read a column store id of infoColumn to list to check duplicateprotected int
m_count
protected GridField
m_gridfield
protected int
m_infoWindowID
protected boolean
m_lookup
protected String
m_sqlCount
Count SQL Statementprotected String
m_sqlMain
Main SQL Statementprotected String
m_sqlOrder
Order By ClauseLinkedHashMap<KeyNamePair,LinkedHashMap<String,Object>>
m_values
protected Collection<KeyNamePair>
m_viewIDMap
save selected id and viewIDprotected int
numPagePreLoad
protected static String
ON_RUN_PROCESS
protected String
p_keyColumn
Key Column Nameprotected ColumnInfo[]
p_layout
Layout of Gridprotected boolean
p_loadedOK
Loading success indicatorprotected boolean
p_multipleSelection
Enable more than one selectionprotected String
p_tableName
Table Nameprotected String
p_whereClause
Initial WHERE Clauseprotected int
p_WindowNo
Master (owning) Windowprotected int
pageNo
protected int
pageSize
protected org.zkoss.zul.Paging
paging
protected List<Object>
prevParameterValues
save value of parameter to set info query paramenterprotected List<String>
prevQueryOperators
protected List<WEditor>
prevRefParmeterEditor
protected String
prevWhereClause
save where clause of prev requeryprotected static String
PROCESS_ID_KEY
protected int
queryTimeout
protected String
queryValue
protected Map<Integer,List<Object>>
recordSelectedData
store selected record info key of map is value of column play as keyView in case has no key coloumn of view, use value ofp_keyColumn
zk6.x listview don't provide event when click to checkbox select all, so we can't manage selectedRecord time by time.protected InfoRelatedVO[]
relatedInfoList
protected String
sqlOrderColumn
protected StatusBarPanel
statusBar
protected boolean
useQueryTimeoutFromSysConfig
static int
VK_ENTER
static int
VK_ESCAPE
-
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, showMaskWrapper
-
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
Constructors Modifier Constructor Description protected
InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause)
Detail Constructorprotected
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)
Detail Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addValueChangeListener(ValueChangeListener listener)
protected void
appendDataForKeyView(ResultSet rs, List<Object> data, List<Integer> listReadedColumn)
save data of all viewID column in infoProcessList to end of data line when overridereadData(ResultSet)
consider call this method IDEMPIERE-1970protected void
appendDataForParentLink(ResultSet rs, List<Object> data, List<Integer> listReadedColumn)
save data of all viewID column in infoProcessList to end of data line when overridereadData(ResultSet)
consider call this method IDEMPIERE-2152protected void
appendDataForViewID(ResultSet rs, List<Object> data, List<Integer> listReadedColumn)
save data of all viewID column in infoProcessList to end of data line when overridereadData(ResultSet)
consider call this method IDEMPIERE-1970protected void
appendInfoColumnData(ResultSet rs, List<Object> data, IInfoColumn[] listModelHasInfoColumn, List<Integer> listReadedColumn)
save data of all infoColumn in listModelHaveInfoColumn to end of data lineprotected void
autoHideEmptyColumns()
auto hide empty columnsprotected void
bindInfoProcess()
evaluate display logic of button process empty method. implement at child class extendprotected String
buildDataSQL(int start, int end)
protected void
correctHeaderOrderIndicator()
static InfoPanel
create(int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, String whereClause)
void
createT_Selection_InfoWindow(int AD_PInstance_ID)
Insert result valuesprotected void
customize()
Customize dialog To be overwritten by concrete classesvoid
dispose(boolean ok)
Dispose and save Selectionprotected void
enableButtons()
enable all control button or disable all rely to selected recordprotected 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
executeQuery()
Execute Queryvoid
fireValueChange(ValueChangeEvent event)
protected int
getAD_Window_ID(String tableName, boolean isSOTrx)
Get Zoom Windowprotected int
getCacheEnd()
protected int
getCacheStart()
Vector<String>
getColumnHeader(ColumnInfo[] p_layout)
protected Integer
getColumnValue(int rowIndex)
get keyView value at rowIndex and clumnIndex also check in case value is null will rise a exceptionString[]
getEvents()
Integer
getFirstRowKey()
GridField
getGridfield()
field call this info panel as search editor null in case info window open in stand-alone window (from menu, fav,...)protected int
getIndexKeyColumnOfView()
get data index of keyViewprotected int
getInfoColumnIDFromProcess(int processId)
Get InfoColumnID of infoProcess have processID is processIdprotected String
getKeyColumn()
Get Key Column Nameprotected AdempiereException
getKeyNullException()
protected int
getOverIntValue(long overValue)
when calculator value at bound, sometime value is overflow by data type this function calculator at high type for avoid itprotected int
getOverIntValue(long overValue, int extra)
seegetOverIntValue(long)
. when value over max_value set it near max_value.int
getPageSize()
int
getRowCount()
Integer
getRowKeyAt(int row)
Collection<KeyNamePair>
getSaveKeys(int infoCulumnId)
Save selected id, viewID of all process to map viewIDMap to save into T_SelectionObject
getSelectedKey()
Get (first) selected KeyObject[]
getSelectedKeys()
Get selected KeysCollection<Integer>
getSelectedKeysCollection()
Deprecated.use getSaveKeysMap<Integer,List<Object>>
getSelectedRowInfo()
update list column key value of selected record and return this listprotected Integer
getSelectedRowKey()
Get the key of currently selected rowprotected ArrayList<Integer>
getSelectedRowKeys()
Deprecated.String
getSelectedSQL()
Get where clause for (first) selected keyString
getSortDirection(Comparator<Object> cmpr)
protected abstract String
getSQLWhere()
Get dynamic WHERE part of SQL To be overwritten by concrete classes When override this method, please consider isQueryByUser and prevWhereClauseprotected List<Object>
getSubList(int fromIndex, int toIndex, List<Object> line)
fromIndex and toIndex calculate with assume always query record astestCount()
example after testCount we get calculate 6page.protected String
getTableName()
Get Table name Synonymprotected String
getUserOrderClause()
build order clause of current sort order, and save it to m_sqlUserOrderprotected String
getUserOrderClause(int col)
build order clause of give column if call that function before init list will raise a NPE. care about your codeint
getWindowNo()
protected boolean
hasCustomize()
Has Customize (false) To be overwritten by concrete classesprotected boolean
hasHistory()
Has History (false) To be overwritten by concrete classesprotected boolean
hasNew()
Has new function for create new record (false) To be overwritten by concrete classesprotected boolean
hasProcess()
Customize dialog To be overwritten by concrete classesprotected boolean
hasZoom()
Has Zoom (false) To be overwritten by concrete classesprotected void
initParameters()
Call after load parameter panel to set init value can call when reset parameter implement this method at inheritance class with each parameter, remember call Env.setContext to set new value to envprotected void
insertPagingComponent()
protected boolean
isAutoHideEmptyColumns()
boolean
isCancelled()
Is cancelled?protected boolean
isIDColumn(Object keyData)
callisIDColumn(Object, boolean)
without check null valueprotected boolean
isIDColumn(Object keyData, boolean isCheckNull)
Check type of object is IDColumnprotected boolean
isLoadPageNumber()
boolean
isLookup()
protected boolean
isNeedAppendKeyViewData()
need overrider at infoWindow to check isDisplayprotected boolean
isUseDatabasePaging()
boolean
loadedOK()
Loaded correctlyprotected void
loadInfoWindowData()
query ADInfoWindow from ADInfoWindowIDprotected void
newRecordAction()
process action when user click to new buttonprotected void
onDoubleClick()
void
onEvent(org.zkoss.zk.ui.event.Event event)
protected void
onOk()
void
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)
boolean
onRestoreSelectedItemIndexInPage(Integer keyViewValue, int rowIndex, Object row)
Hook to intercept 'restore selection' actionsvoid
onUserQuery()
Call query when user click to query button enter in parameter fieldprotected void
parseQueryValue()
protected void
prepareTable(ColumnInfo[] layout, String from, String where, String orderBy)
protected void
renderItems()
protected void
resetParameters()
Reset parameter to default value or to empty value?protected void
restoreSelectedInPage()
go through all data record, in case key value is inrecordSelectedData
, mark it as selected recordprotected void
runProcess(Object processIdObj)
Run a process.protected void
saveResultSelection(int infoColumnId)
save result valuesprotected void
saveSelection()
Save Selection - Called by disposeprotected void
saveSelectionDetail()
Save Selection Details To be overwritten by concrete classes this function call when close info window.void
scrollToSelectedRow()
void
setFixedQueryTimeout(int timeout)
set fixed query timeout value, overwrite the value from sysconfigvoid
setGridfield(GridField m_gridfield)
protected abstract void
setParameters(PreparedStatement pstmt, boolean forCount)
Set Parameters for Query To be overwritten by concrete classes When override this method, please consider isQueryByUser and prevWhereClausevoid
setStatusDB(String text)
Set Status DBvoid
setStatusLine(String text, boolean error)
Set Status Linevoid
setStatusSelected()
Set Status DBprotected void
showHistory()
notify to search editor of a value change in the selection infostatic void
showPanel(String tableName)
Show panel based on tablename (non modal)void
sort(Comparator<Object> cmpr, boolean ascending)
protected void
syncSelectedAfterRequery()
in case requery data, but want store selected record (example when run success a process) we must sync selected row, because some selected row maybe not at data list (process make it change not map with query) current 1000 line cache because in case query get more 1000 record we can't sync or maintain selected record (ever maintain for current page will make user confuse).void
tableChanged(WTableModelEvent event)
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.protected boolean
testCount()
Test Row Countprotected 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)
protected void
updateStatusBar(int no)
protected void
updateSubcontent()
Update relate info when selection in main info changeprotected void
updateSubcontent(int targetRow)
Update relate info for a specific row, if targetRow < 0 update using selected rowprotected void
validateEndPage()
after query from database, process validate.protected void
validateOrderIndex()
column of grid isn't fix, it can change by display logic of column each time load dataInfoWindow.prepareTable(ColumnInfo[], String, String, String)
so need to validate it by compare sql of current sort columnboolean
validateParameters()
validate parameter before run queryvoid
zoom()
-
Methods inherited from class org.adempiere.webui.component.Window
dispose, getMaskComponent, getMaskObj, getModeAttribute, hideMask, 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.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellow
-
-
-
-
Field Detail
-
INFO_QUERY_TIME_OUT_ERROR
protected static final String INFO_QUERY_TIME_OUT_ERROR
- See Also:
- Constant Field Values
-
COLUMN_VISIBLE_ORIGINAL
protected static final String COLUMN_VISIBLE_ORIGINAL
- See Also:
- Constant Field Values
-
PROCESS_ID_KEY
protected static final String PROCESS_ID_KEY
- See Also:
- Constant Field Values
-
ON_RUN_PROCESS
protected static final String ON_RUN_PROCESS
- See Also:
- Constant Field Values
-
ATT_INFO_PROCESS_KEY
protected static final String ATT_INFO_PROCESS_KEY
- See Also:
- Constant Field Values
-
pageSize
protected int pageSize
-
m_values
public LinkedHashMap<KeyNamePair,LinkedHashMap<String,Object>> m_values
-
relatedInfoList
protected InfoRelatedVO[] relatedInfoList
-
isIgnoreCacheAll
protected boolean isIgnoreCacheAll
-
numPagePreLoad
protected int numPagePreLoad
-
extra_max_row
protected int extra_max_row
-
keyColumnOfView
protected MInfoColumn keyColumnOfView
MInfoColumn has isKey = true, play as key column in case non column has isKey = true, this column is null and we usep_keyColumn
-
indexKeyOfView
protected int indexKeyOfView
index ofkeyColumnOfView
in data model, set when prepare listbox
-
isIDColumnKeyOfView
protected boolean isIDColumnKeyOfView
-
hasRightQuickEntry
protected boolean hasRightQuickEntry
-
isHasNextPage
protected boolean isHasNextPage
-
recordSelectedData
protected Map<Integer,List<Object>> recordSelectedData
store selected record info key of map is value of column play as keyView in case has no key coloumn of view, use value ofp_keyColumn
zk6.x listview don't provide event when click to checkbox select all, so we can't manage selectedRecord time by time. each time change page we will update this list with current selected record of this page by call functionupdateListSelected()
when move to zk7, just enough handle onclick. because don't direct use recordSelectedData, callgetSelectedRowInfo()
-
isRequeryByRunSuccessProcess
protected boolean isRequeryByRunSuccessProcess
when requery but don't clear selected record (example after run process) set flag to true to run sync selected record, alsosyncSelectedAfterRequery()
-
m_lookup
protected boolean m_lookup
-
m_infoWindowID
protected int m_infoWindowID
-
confirmPanel
protected ConfirmPanel confirmPanel
-
p_WindowNo
protected int p_WindowNo
Master (owning) Window
-
p_tableName
protected String p_tableName
Table Name
-
p_keyColumn
protected String p_keyColumn
Key Column Name
-
p_multipleSelection
protected boolean p_multipleSelection
Enable more than one selection
-
p_whereClause
protected String p_whereClause
Initial WHERE Clause
-
statusBar
protected StatusBarPanel statusBar
-
p_layout
protected ColumnInfo[] p_layout
Layout of Grid
-
m_sqlMain
protected String m_sqlMain
Main SQL Statement
-
m_sqlCount
protected String m_sqlCount
Count SQL Statement
-
m_sqlOrder
protected String m_sqlOrder
Order By Clause
-
indexOrderColumn
protected int indexOrderColumn
-
sqlOrderColumn
protected String sqlOrderColumn
-
isColumnSortAscending
protected Boolean isColumnSortAscending
-
p_loadedOK
protected boolean p_loadedOK
Loading success indicator
-
infoWindow
protected MInfoWindow infoWindow
-
log
protected transient CLogger log
Logger
-
contentPanel
protected WListbox contentPanel
-
paging
protected org.zkoss.zul.Paging paging
-
pageNo
protected int pageNo
-
m_count
protected int m_count
-
m_gridfield
protected GridField m_gridfield
-
isQueryByUser
protected boolean isQueryByUser
false, use saved where clause IDEMPIERE-1979
-
isAutoComplete
protected boolean isAutoComplete
-
queryTimeout
protected int queryTimeout
-
useQueryTimeoutFromSysConfig
protected boolean useQueryTimeoutFromSysConfig
-
autoCompleteSearchColumn
protected String autoCompleteSearchColumn
-
queryValue
protected String queryValue
-
prevWhereClause
protected String prevWhereClause
save where clause of prev requery
-
prevParameterValues
protected List<Object> prevParameterValues
save value of parameter to set info query paramenter
-
infoProcessList
protected MInfoProcess[] infoProcessList
All info process of this infoWindow
-
haveProcess
protected boolean haveProcess
flag detect exists info process
-
infoProcessBtList
protected List<MInfoProcess> infoProcessBtList
Info process have style is button
-
infoProcessDropList
protected List<MInfoProcess> infoProcessDropList
Info process have style is drop down list
-
infoProcessMenuList
protected List<MInfoProcess> infoProcessMenuList
Info process have style is menu
-
m_viewIDMap
protected Collection<KeyNamePair> m_viewIDMap
save selected id and viewID
-
columnDataIndex
protected Map<Integer,Integer> columnDataIndex
store index of infoColumn have data append. each infoColumn just append only one time. index increase from 0.
-
isMustUpdateColumnIndex
protected boolean isMustUpdateColumnIndex
after load first record, set it to false. when need update index of column data append to end of listcolumnDataIndex
, set it to true
-
indexColumnCount
protected int indexColumnCount
When start update index of column data append to end of listcolumnDataIndex
, reset it to 0, each read data for new append column, increase it up 1
-
lsReadedColumn
protected List<Integer> lsReadedColumn
to prevent append duplicate data, when begin read each record reset this list, when read a column store id of infoColumn to list to check duplicate
-
btCbbProcess
protected Button btCbbProcess
IDEMPIERE-1334 button and combobox when layout process button as dropdow list
-
cbbProcess
protected Combobox cbbProcess
-
btMenuProcess
protected Button btMenuProcess
-
VK_ENTER
public static final int VK_ENTER
- See Also:
- Constant Field Values
-
VK_ESCAPE
public static final int VK_ESCAPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause)
Detail Constructor- Parameters:
WindowNo
- WindowNotableName
- tableNamekeyColumn
- keyColumnwhereClause
- whereClause
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup)
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, int ADInfoWindowID)
-
InfoPanel
protected InfoPanel(int WindowNo, String tableName, String keyColumn, boolean multipleSelection, String whereClause, boolean lookup, int ADInfoWindowID, String queryValue)
Detail Constructor- Parameters:
WindowNo
- WindowNotableName
- tableNamekeyColumn
- keyColumnwhereClause
- whereClausequeryValue
-
-
-
Method Detail
-
create
public static InfoPanel create(int WindowNo, String tableName, String keyColumn, String value, boolean multiSelection, String whereClause)
-
showPanel
public static void showPanel(String tableName)
Show panel based on tablename (non modal)- Parameters:
tableName
-
-
parseQueryValue
protected void parseQueryValue()
-
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
public void setStatusLine(String text, boolean error)
Set Status Line- Parameters:
text
- texterror
- error
-
setStatusDB
public void setStatusDB(String text)
Set Status DB- Parameters:
text
- text
-
setStatusSelected
public void setStatusSelected()
Set Status DB
-
prepareTable
protected void prepareTable(ColumnInfo[] layout, String from, String where, String orderBy)
-
isLoadPageNumber
protected boolean isLoadPageNumber()
-
executeQuery
protected void executeQuery()
Execute Query
-
appendDataForViewID
protected void appendDataForViewID(ResultSet rs, List<Object> data, List<Integer> listReadedColumn) throws SQLException
save data of all viewID column in infoProcessList to end of data line when overridereadData(ResultSet)
consider call this method IDEMPIERE-1970- Parameters:
rs
- record set to read datadata
- data line to appendlistReadedColumn
- list column is appended- Throws:
SQLException
-
appendDataForParentLink
protected void appendDataForParentLink(ResultSet rs, List<Object> data, List<Integer> listReadedColumn) throws SQLException
save data of all viewID column in infoProcessList to end of data line when overridereadData(ResultSet)
consider call this method IDEMPIERE-2152- Parameters:
rs
-data
-listReadedColumn
-- Throws:
SQLException
-
appendDataForKeyView
protected void appendDataForKeyView(ResultSet rs, List<Object> data, List<Integer> listReadedColumn) throws SQLException
save data of all viewID column in infoProcessList to end of data line when overridereadData(ResultSet)
consider call 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
save data of all infoColumn in listModelHaveInfoColumn to end of data line- Parameters:
rs
- record set to read datadata
- data line to appendlistModelHasInfoColumn
-listReadedColumn
- list column is appended- Throws:
SQLException
-
renderItems
protected void renderItems()
-
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)
-
validateEndPage
protected void validateEndPage()
after query from database, process validate. if end page include in cache, process calculate total record if current page is out of page (no record is query) process query count to detect end page
-
getSubList
protected List<Object> getSubList(int fromIndex, int toIndex, List<Object> line)
fromIndex and toIndex calculate with assume always query record astestCount()
example after testCount we get calculate 6page. when user navigate to page 4. something change in system (a batch record change become don't match with search query) let we just get 5 page with current parameter. so when user navigate to page 6. user will face with index issue. (out of index or start index > end index) this function is fix for it.- Parameters:
fromIndex
-toIndex
-line
-- Returns:
-
getOverIntValue
protected int getOverIntValue(long overValue)
when calculator value at bound, sometime value is overflow by data type this function calculator at high type for avoid it- Parameters:
overValue
-- Returns:
-
getOverIntValue
protected int getOverIntValue(long overValue, int extra)
seegetOverIntValue(long)
. when value over max_value set it near max_value.- Parameters:
overValue
-extra
-- Returns:
-
buildDataSQL
protected String buildDataSQL(int start, int end)
-
validateOrderIndex
protected void validateOrderIndex()
column of grid isn't fix, it can change by display logic of column each time load dataInfoWindow.prepareTable(ColumnInfo[], String, String, String)
so need to validate it by compare sql of current sort column
-
getUserOrderClause
protected String getUserOrderClause()
build order clause of current sort order, and save it to m_sqlUserOrder- Returns:
-
getUserOrderClause
protected String getUserOrderClause(int col)
build order clause of give column if call that function before init list will raise a NPE. care about your code- Parameters:
col
-- Returns:
-
insertPagingComponent
protected void insertPagingComponent()
-
getColumnHeader
public Vector<String> getColumnHeader(ColumnInfo[] p_layout)
-
testCount
protected boolean testCount()
Test Row Count- Returns:
- true if display
-
saveSelection
protected void saveSelection()
Save Selection - Called by dispose
-
getSelectedRowKey
protected Integer getSelectedRowKey()
Get the key of currently selected row- Returns:
- selected key
-
getSelectedRowKeys
protected ArrayList<Integer> getSelectedRowKeys()
Deprecated.Get the keys of selected row/s based on layout defined in prepareTable- Returns:
- IDs if selection present author ashley
-
getSelectedKeysCollection
public Collection<Integer> getSelectedKeysCollection()
Deprecated.use getSaveKeysGet selected Keys as Collection- Returns:
- selected keys (Integers)
-
getSaveKeys
public Collection<KeyNamePair> getSaveKeys(int infoCulumnId)
Save selected id, viewID of all process to map viewIDMap to save into T_Selection
-
isNeedAppendKeyViewData
protected boolean isNeedAppendKeyViewData()
need overrider at infoWindow to check isDisplay- Returns:
-
isIDColumn
protected boolean isIDColumn(Object keyData, boolean isCheckNull)
Check type of object is IDColumn- Parameters:
keyData
-isCheckNull
- when true, raise exception when data is null- Returns:
-
isIDColumn
protected boolean isIDColumn(Object keyData)
callisIDColumn(Object, boolean)
without check null value- Parameters:
keyData
-- Returns:
-
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 data index of keyView- Returns:
-
restoreSelectedInPage
protected void restoreSelectedInPage()
go through all data record, in case key value is inrecordSelectedData
, mark it as selected record
-
onRestoreSelectedItemIndexInPage
public boolean onRestoreSelectedItemIndexInPage(Integer keyViewValue, int rowIndex, Object row)
Hook to intercept 'restore selection' actions- Parameters:
keyViewValue
- row view keyrowIndex
- row indexrow
- row- Returns:
- false to skip restore selection
-
getKeyNullException
protected AdempiereException getKeyNullException()
-
getColumnValue
protected Integer getColumnValue(int rowIndex)
get keyView value at rowIndex and clumnIndex also check in case value is null will rise a exception- Parameters:
rowIndex
-- Returns:
-
syncSelectedAfterRequery
protected void syncSelectedAfterRequery()
in case requery data, but want store selected record (example when run success a process) we must sync selected row, because some selected row maybe not at data list (process make it change not map with query) current 1000 line cache because in case query get more 1000 record we can't sync or maintain selected record (ever maintain for current page will make user confuse). just clear selection in case < 1000 record is ok TODO:rewrite
-
getSelectedRowInfo
public Map<Integer,List<Object>> getSelectedRowInfo()
update list column key value of selected record and return this list- Returns:
recordSelectedData
after update
-
getSelectedKeys
public Object[] getSelectedKeys()
Get selected Keys- Returns:
- selected keys (Integers)
-
getSelectedKey
public Object 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
public String getSelectedSQL()
Get where clause for (first) selected key- Returns:
- WHERE Clause
-
loadInfoWindowData
protected void loadInfoWindowData()
query ADInfoWindow from ADInfoWindowID
-
getTableName
protected String getTableName()
Get Table name Synonym- Returns:
- table name
-
getKeyColumn
protected String getKeyColumn()
Get Key Column Name- Returns:
- column name
-
getEvents
public String[] getEvents()
-
enableButtons
protected void enableButtons()
enable all control button or disable all rely to selected record
-
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
protected abstract String getSQLWhere()
Get dynamic WHERE part of SQL To be overwritten by concrete classes When override this method, please consider isQueryByUser and prevWhereClause- Returns:
- WHERE clause
-
setParameters
protected abstract void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException
Set Parameters for Query To be overwritten by concrete classes When override this method, please consider isQueryByUser and prevWhereClause- Parameters:
pstmt
- statementforCount
- for counting records- Throws:
SQLException
-
showHistory
protected void showHistory()
notify to search editor of a value change in the selection info
-
hasHistory
protected boolean hasHistory()
Has History (false) To be overwritten by concrete classes- Returns:
- true if it has history (default false)
-
hasProcess
protected boolean hasProcess()
Customize dialog To be overwritten by concrete classes
-
customize
protected void customize()
Customize dialog To be overwritten by concrete classes
-
hasCustomize
protected boolean hasCustomize()
Has Customize (false) To be overwritten by concrete classes- Returns:
- true if it has customize (default false)
-
hasZoom
protected boolean hasZoom()
Has Zoom (false) To be overwritten by concrete classes- Returns:
- true if it has zoom (default false)
-
hasNew
protected boolean hasNew()
Has new function for create new record (false) To be overwritten by concrete classes- Returns:
-
saveSelectionDetail
protected void saveSelectionDetail()
Save Selection Details To be overwritten by concrete classes this function call when close info window. default infoWindow will set value of all column of current selected record to environment variable withEnv.TAB_INFO
class extends can do more by override it.
-
getAD_Window_ID
protected int getAD_Window_ID(String tableName, boolean isSOTrx)
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>
-
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:
-
initParameters
protected void initParameters()
Call after load parameter panel to set init value can call when reset parameter implement this method at inheritance class with each parameter, remember call Env.setContext to set new value to env
-
updateSubcontent
protected void updateSubcontent()
Update relate info when selection in main info change
-
updateSubcontent
protected void updateSubcontent(int targetRow)
Update relate 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? implement at inheritance class when reset parameter maybe need init again parameter, reset again default value
-
runProcess
protected void runProcess(Object processIdObj)
Run a process. show process dialog, before start process, save id of record selected after run process, show message report result- Parameters:
processIdObj
-
-
saveResultSelection
protected void saveResultSelection(int infoColumnId)
save result values
-
createT_Selection_InfoWindow
public void createT_Selection_InfoWindow(int AD_PInstance_ID)
Insert result values- Parameters:
AD_PInstance_ID
-
-
getInfoColumnIDFromProcess
protected int getInfoColumnIDFromProcess(int processId)
Get InfoColumnID of infoProcess have processID is processId- Parameters:
processId
-- Returns:
- value InfoColumnID, -1 when has not any map
-
correctHeaderOrderIndicator
protected void correctHeaderOrderIndicator()
-
onQueryCallback
public void onQueryCallback(org.zkoss.zk.ui.event.Event event)
-
bindInfoProcess
protected void bindInfoProcess()
evaluate display logic of button process empty method. implement at child class extend
-
onOk
protected void onOk()
-
onDoubleClick
protected void onDoubleClick()
-
tableChanged
public void tableChanged(WTableModelEvent event)
Description copied from interface:WTableModelListener
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.- Specified by:
tableChanged
in interfaceWTableModelListener
- Parameters:
event
- table model event
-
zoom
public void zoom()
-
newRecordAction
protected void newRecordAction()
process action when user click to new button
-
addValueChangeListener
public void addValueChangeListener(ValueChangeListener listener)
-
fireValueChange
public void fireValueChange(ValueChangeEvent event)
-
dispose
public void dispose(boolean ok)
Dispose and save Selection- Parameters:
ok
- OK pressed
-
sort
public void sort(Comparator<Object> cmpr, boolean ascending)
- Specified by:
sort
in interfaceorg.zkoss.zul.ext.Sortable<Object>
-
isLookup
public boolean isLookup()
-
scrollToSelectedRow
public void scrollToSelectedRow()
-
getSortDirection
public String getSortDirection(Comparator<Object> cmpr)
- Specified by:
getSortDirection
in interfaceorg.zkoss.zul.ext.Sortable<Object>
-
getWindowNo
public int getWindowNo()
-
getRowCount
public int getRowCount()
-
getFirstRowKey
public Integer getFirstRowKey()
-
getRowKeyAt
public Integer getRowKeyAt(int row)
-
getCacheStart
protected int getCacheStart()
- Returns:
- the cacheStart
-
getCacheEnd
protected int getCacheEnd()
- Returns:
- the cacheEnd
-
isUseDatabasePaging
protected boolean isUseDatabasePaging()
-
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
public GridField getGridfield()
field call this info panel as search editor null in case info window open in stand-alone window (from menu, fav,...)- Returns:
-
setGridfield
public void setGridfield(GridField m_gridfield)
-
getPageSize
public int getPageSize()
-
-