psdi.webclient.system.beans

Class ResultsBean

    • Field Detail

      • recordsFetched

        protected boolean recordsFetched
      • usesubset

        protected boolean usesubset
      • recordsSelected

        protected int recordsSelected
      • appBean

        protected AppBean appBean
      • subSelectMaxRows

        protected int subSelectMaxRows
      • recChanged

        protected boolean recChanged
      • listTableChanges

        protected java.util.HashMap listTableChanges
    • Constructor Detail

      • ResultsBean

        public ResultsBean()
    • Method Detail

      • addListener

        public void addListener(DataBeanListener listener)
        Adds a listener (child DataBean) to this DataBean (parent). relateField is the field in the parent that the child listens to so if just the field is changed then the listeners parentChanged methods will be call.
        Overrides:
        addListener in class DataBean
      • reset

        public void reset()
                   throws MXException
        Resets the MboSet. Clears the internal cache and fires a structure change event to all listeners. Throws MXException or RemoteException on failure
        Overrides:
        reset in class DataBean
        Throws:
        MXException
      • recHasChanged

        public void recHasChanged()
        Called by the RecordMboSetBean when it is saved. Sets the setRecChanged flag which is checked by the TableTag for tables of type "results", to see if the mboSet needs to be reset in order for the changes to be seen in the table.
      • isAppLockEnabled

        public boolean isAppLockEnabled()
        Returns a boolean indicating if the app this bean is on is enabled for Record Locking
        Returns:
      • hasRecChanged

        public boolean hasRecChanged()
        Returns the recChanged flag. True means the there have been changes and the MboSet needs to be refreshed to see them.
      • getMboSet

        public MboSetRemote getMboSet()
                               throws MXException,
                                      java.rmi.RemoteException
        Returns the MboSetRemote of the DataBean. If there isn't a remote it will try and get one from the MXSession or parent Mbo (if there is one). This method should be overridden if there if the MboSetRemote needs to be obtained a different way.
        Overrides:
        getMboSet in class DataBean
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException
        Saves the changes made to the MboSet Throws MXException or RemoteException on failure The MboSet data or cached data will be undisturbed.
        Overrides:
        save in class DataBean
        Throws:
        MXException
      • setCurrentRow

        public boolean setCurrentRow(int nRow)
                              throws MXException,
                                     java.rmi.RemoteException
        Changes the current row position. Returns true, if the row exists in the result set otherwise false. Throws MXException or RemoteException on failure
        Overrides:
        setCurrentRow in class DataBean
        Throws:
        MXException
        java.rmi.RemoteException
      • setSubSetMaxRowCount

        public void setSubSetMaxRowCount(int maxrows)
        Set the maximun number of row the mboset can have when in subselect mode.
      • resetSelectedCache

        public void resetSelectedCache()
        Clears the selectedIndex array of all selected indexes.
      • getFirstRecord

        public void getFirstRecord()
        Sets the ResultsSetBean to the first record in the reseult set (if there is one) This is called by the RecordMboSetBean, when it tries to get it's current record.
      • search

        public int search()
                   throws MXException,
                          java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • togglesubselect

        public int togglesubselect()
                            throws MXException,
                                   java.rmi.RemoteException
        Sets the subeselect flag to determine if the results table is in subselect mode (using multi-select)
        Throws:
        MXException
        java.rmi.RemoteException
      • useSubSelect

        public boolean useSubSelect()
        Returns the usesubset flag which for determining if an action taken on the results set should be done on all records or just the selected ones.
      • unselect

        public void unselect(int startIndex,
                             int count)
                      throws MXException
        Marks the a set of Mbos starting from startIndex Unselected.
        Overrides:
        unselect in class DataBean
        Parameters:
        startIndex - starting index position (must be >= 0)
        count - number of Mbos after the start index to be marked unselected (must be > 0).
        Throws:
        MXException
      • select

        public void select(int startIndex,
                           int count)
                    throws MXException
        Marks the a set of Mbos starting from startIndex selected.
        Overrides:
        select in class DataBean
        Parameters:
        startIndex - starting index position (must be >= 0)
        count - number of Mbos after the start index to be marked unselected (must be > 0).
        Throws:
        MXException
      • next

        public boolean next()
                     throws MXException
        Advances the current row position. Fires a row change event to all listeners upon success. Throws MXException or RemoteException on failure
        Overrides:
        next in class DataBean
        Throws:
        MXException
      • previous

        public boolean previous()
                         throws MXException
        Decrements the current row position. Fires a row change event to all listeners upon success. Throws MXException or RemoteException on failure
        Overrides:
        previous in class DataBean
        Throws:
        MXException
      • findFirstSelectedIndex

        public int findFirstSelectedIndex()
        Returns the index of the first selected mbo.
      • allSelected

        public boolean allSelected()
        Returns boolean true if all records are selected
      • setupBean

        public void setupBean(WebClientSession wcs)
        Description copied from class: DataBean
        This method must be call after the bean is instantiated. It tells the bean what it's clientSession is , the control that created the bean and the event that caused the creation of the bean. Also gets the values the orderyby, whereclause, apprestrictions, rowsperpage, and parentdatasrc properties from the control (the one that instantiated the bean) if any are set. Plus it gets the list of bound controls from the presentations control handler.
        Overrides:
        setupBean in class DataBean
      • hasRecordsForAction

        public boolean hasRecordsForAction()
                                    throws MXException
        Returns true if the ResultsBean has records to perform an action on. Which means the List table is in sub-select mode and the user has selected records or the table is not in sub-select mode then see's if the ResultsBena has any records.
        Returns:
        Throws:
        MXException
      • initialize

        protected void initialize()
                           throws MXException,
                                  java.rmi.RemoteException
        Description copied from class: DataBean
        Typically called after the DataBean gets a new MboSetRemote On the MboSetRemote it sets the app, the app defaults, user defaults If the remote is an instanceof NonPersistentMboSetRemote then setup is called on it and sets the current row to 0. If the DataBean isn't bound to a table then initialize fetches the first mbo (sets the current row to 0). If this method is overridden under most case you will want to call super.initalize at the end of the the new initialize method.
        Overrides:
        initialize in class DataBean
        Throws:
        MXException
        java.rmi.RemoteException
      • BOOKMARK

        public int BOOKMARK()
                     throws MXException,
                            java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • setStartEmpty

        public void setStartEmpty()
      • turnEmptyStateOff

        public void turnEmptyStateOff()
                               throws MXException,
                                      java.rmi.RemoteException
        Resets the start empty state flag off to allow the dean to fetch the data.
        Throws:
        MXException
        java.rmi.RemoteException
      • turnEmptyStateOff

        public void turnEmptyStateOff(boolean dofetch)
                               throws MXException,
                                      java.rmi.RemoteException
        Resets the start empty state flag off to allow the dean to fetch the data. If dofetch parameter is true then the first record will be fetched.
        Throws:
        MXException
        java.rmi.RemoteException
      • getDataAsArray

        public java.lang.String[][] getDataAsArray(java.lang.String[] attributeNames)
        Description copied from class: DataBean
        For the given list of attributes, this returns all rows of data in an array where the first level is the rows of data and the second level is the data for each of the attributes in that row. If there isn't data for a particular attribute in a row then "" is returned in the array for it's data. Also the first "row" in the array is the list of attributes used to retrieve the data for the array.
        Overrides:
        getDataAsArray in class DataBean
      • getSelectedDataAsArray

        public java.lang.String[][] getSelectedDataAsArray(java.lang.String[] attributeNames)
        Description copied from class: DataBean
        For the given list of attributes, this returns just the selected rows of data, (if no rows are selected then all rows are used) in an array where the first level is the rows of data and the second level is the data for each of the attributes in that row. If there isn't data for a particular attribute in a row then "" is returned in the array for it's data. Also the first "row" in the array is the list of attributes used to retrieve the data for the array.
        Overrides:
        getSelectedDataAsArray in class DataBean
      • getResetFromQbeclearInit

        public boolean getResetFromQbeclearInit()
      • setResetFromQbeclearInit

        public void setResetFromQbeclearInit(boolean flag)
      • setQbeDefaults

        public void setQbeDefaults()
        Overrided to always force the setting of default qbe values when called.
        Overrides:
        setQbeDefaults in class DataBean
      • recHasChanged

        public void recHasChanged(int oper)
        Called by the RecordMboSetBean when it is saved. For tables of type "results", to see if the mboSet needs to be reset in order for the changes to be seen in the table. The state of the row changed is maintained in a hashmap. Only updates and deletes are tracked.In case of insert the refresh of table is bypassed but nothing is tracked.
        Parameters:
        oper - - ROW_INSERT,ROW_MODIFY,ROW_DELETE
      • clearTableRetainCache

        public void clearTableRetainCache()
        reset the cache used to track the list table state
      • isModifiedRow

        public boolean isModifiedRow(int thisRow)
        Track if the record is modified
        Overrides:
        isModifiedRow in class DataBean
        Returns:
        true or false
      • isRowDeleted

        public boolean isRowDeleted(int thisRow)
        Track if the record is deleted
        Overrides:
        isRowDeleted in class DataBean
        Returns:
        true or false
      • resetDataBean

        protected void resetDataBean()
        Overide databean method to clean up local cache which tracks changes.
        Overrides:
        resetDataBean in class DataBean