Class InfoPanel

    • Field Detail

      • btProcessList

        protected List<Button> btProcessList
      • pageSize

        protected int pageSize
      • 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 use p_keyColumn
      • indexKeyOfView

        protected int indexKeyOfView
        index of keyColumnOfView 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 of p_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 function updateListSelected() when move to zk7, just enough handle onclick. because don't direct use recordSelectedData, call getSelectedRowInfo()
      • 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, also syncSelectedAfterRequery()
      • m_lookup

        protected boolean m_lookup
      • m_infoWindowID

        protected int m_infoWindowID
      • 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
      • 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
      • 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
      • prevQueryOperators

        protected List<String> prevQueryOperators
      • prevRefParmeterEditor

        protected List<WEditor> prevRefParmeterEditor
      • 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
      • 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 list columnDataIndex, set it to true
      • indexColumnCount

        protected int indexColumnCount
        When start update index of column data append to end of list columnDataIndex, 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
    • Constructor Detail

      • InfoPanel

        protected InfoPanel​(int WindowNo,
                            String tableName,
                            String keyColumn,
                            boolean multipleSelection,
                            String whereClause)
        Detail Constructor
        Parameters:
        WindowNo - WindowNo
        tableName - tableName
        keyColumn - keyColumn
        whereClause - 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 - WindowNo
        tableName - tableName
        keyColumn - keyColumn
        whereClause - whereClause
        queryValue -
    • Method Detail

      • 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 - text
        error - error
      • setStatusDB

        public void setStatusDB​(String text)
        Set Status DB
        Parameters:
        text - text
      • setStatusSelected

        public void setStatusSelected()
        Set Status DB
      • 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 override readData(ResultSet) consider call this method IDEMPIERE-1970
        Parameters:
        rs - record set to read data
        data - data line to append
        listReadedColumn - 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 override readData(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 override readData(ResultSet) consider call this method IDEMPIERE-1970
        Parameters:
        rs - record set to read data
        data - data line to append
        listReadedColumn - 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 data
        data - data line to append
        listModelHasInfoColumn -
        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 as testCount() 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)
        see getOverIntValue(long). when value over max_value set it near max_value.
        Parameters:
        overValue -
        extra -
        Returns:
      • buildDataSQL

        protected String buildDataSQL​(int start,
                                      int end)
      • 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()
      • 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 getSaveKeys
        Get 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:
      • getIndexKeyColumnOfView

        protected int getIndexKeyColumnOfView()
        get data index of keyView
        Returns:
      • restoreSelectedInPage

        protected void restoreSelectedInPage()
        go through all data record, in case key value is in recordSelectedData, 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 key
        rowIndex - row index
        row - row
        Returns:
        false to skip restore selection
      • 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
      • 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 - statement
        forCount - 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 with Env.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 name
        isSOTrx - sales trx
        Returns:
        AD_Window_ID
      • onEvent

        public void onEvent​(org.zkoss.zk.ui.event.Event event)
        Specified by:
        onEvent in interface org.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()
      • zoom

        public void zoom()
      • newRecordAction

        protected void newRecordAction()
        process action when user click to new button
      • addValueChangeListener

        public void addValueChangeListener​(ValueChangeListener listener)
      • 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 interface org.zkoss.zul.ext.Sortable<Object>
      • isLookup

        public boolean isLookup()
      • scrollToSelectedRow

        public void scrollToSelectedRow()
      • getSortDirection

        public String getSortDirection​(Comparator<Object> cmpr)
        Specified by:
        getSortDirection in interface org.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 interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        onPageAttached in class org.zkoss.zk.ui.AbstractComponent
      • onPageDetached

        public void onPageDetached​(org.zkoss.zk.ui.Page page)
        Specified by:
        onPageDetached in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        onPageDetached in class Window
      • 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()