/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { // Copy the key field to the master file and BYPASS the BEHAVIORS super.doValidRecord(bDisplayOption); if (m_bMoveOnValid) { int iMoveType = DBConstants.SCREEN_MOVE; // Do trigger a record change. this.moveTheData(bDisplayOption, iMoveType); } } /**
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { // Copy the key field to the master file and BYPASS the BEHAVIORS super.doValidRecord(bDisplayOption); if (m_bMoveOnValid) { int iMoveType = DBConstants.SCREEN_MOVE; // Do trigger a record change. this.moveTheData(bDisplayOption, iMoveType); } } /**
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { // Copy the key field to the master file and BYPASS the BEHAVIORS super.doValidRecord(bDisplayOption); if (m_bMoveOnValid) { int iMoveType = DBConstants.SCREEN_MOVE; // Do trigger a record change. this.moveTheData(bDisplayOption, iMoveType); } } /**
/** * Called when a change is the record status is about to happen/has happened. * If this file is selected (opened) move the field. * @param field If this file change is due to a field, this is the field. * @param iChangeType The type of change that occurred. * @param bDisplayOption If true, display any changes. * @return an error code. */ public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Read a valid record int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; if (((iChangeType == DBConstants.SELECT_TYPE) && (m_bMoveOnSelect)) || ((iChangeType == DBConstants.AFTER_ADD_TYPE) && (m_bMoveOnAdd)) || ((iChangeType == DBConstants.AFTER_UPDATE_TYPE) && (m_bMoveOnUpdate))) this.moveTheData(bDisplayOption, DBConstants.SCREEN_MOVE); // Do trigger a record change. return iErrorCode; } /**
/** * Called when a change is the record status is about to happen/has happened. * If this file is selected (opened) move the field. * @param field If this file change is due to a field, this is the field. * @param iChangeType The type of change that occurred. * @param bDisplayOption If true, display any changes. * @return an error code. */ public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Read a valid record int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; if (((iChangeType == DBConstants.SELECT_TYPE) && (m_bMoveOnSelect)) || ((iChangeType == DBConstants.AFTER_ADD_TYPE) && (m_bMoveOnAdd)) || ((iChangeType == DBConstants.AFTER_UPDATE_TYPE) && (m_bMoveOnUpdate))) this.moveTheData(bDisplayOption, DBConstants.SCREEN_MOVE); // Do trigger a record change. return iErrorCode; } /**
/** * Called when a change is the record status is about to happen/has happened. * If this file is selected (opened) move the field. * @param field If this file change is due to a field, this is the field. * @param iChangeType The type of change that occurred. * @param bDisplayOption If true, display any changes. * @return an error code. */ public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) { // Read a valid record int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; if (((iChangeType == DBConstants.SELECT_TYPE) && (m_bMoveOnSelect)) || ((iChangeType == DBConstants.AFTER_ADD_TYPE) && (m_bMoveOnAdd)) || ((iChangeType == DBConstants.AFTER_UPDATE_TYPE) && (m_bMoveOnUpdate))) this.moveTheData(bDisplayOption, DBConstants.SCREEN_MOVE); // Do trigger a record change. return iErrorCode; } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() == null) return; if (m_fldDest.getRecord() != this.getOwner()) // If field is not in this file, remember to remove it m_fldDest.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner()) if (m_fldSource.getRecord() != m_fldDest.getRecord()) m_fldSource.addListener(new FieldRemoveBOnCloseHandler(this)); if ((this.getOwner().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getOwner().getEditMode() == DBConstants.EDIT_IN_PROGRESS)) if (m_bMoveOnValid) this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do trigger a record change. if (this.getOwner().getEditMode() == DBConstants.EDIT_ADD) if (m_bMoveOnNew) this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do trigger a record change. } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() == null) return; if (m_fldDest.getRecord() != this.getOwner()) // If field is not in this file, remember to remove it m_fldDest.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner()) if (m_fldSource.getRecord() != m_fldDest.getRecord()) m_fldSource.addListener(new FieldRemoveBOnCloseHandler(this)); if ((this.getOwner().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getOwner().getEditMode() == DBConstants.EDIT_IN_PROGRESS)) if (m_bMoveOnValid) this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do trigger a record change. if (this.getOwner().getEditMode() == DBConstants.EDIT_ADD) if (m_bMoveOnNew) this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do trigger a record change. } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() == null) return; if (m_fldDest.getRecord() != this.getOwner()) // If field is not in this file, remember to remove it m_fldDest.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner()) if (m_fldSource.getRecord() != m_fldDest.getRecord()) m_fldSource.addListener(new FieldRemoveBOnCloseHandler(this)); if ((this.getOwner().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getOwner().getEditMode() == DBConstants.EDIT_IN_PROGRESS)) if (m_bMoveOnValid) this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do trigger a record change. if (this.getOwner().getEditMode() == DBConstants.EDIT_ADD) if (m_bMoveOnNew) this.moveTheData(DBConstants.DISPLAY, DBConstants.INIT_MOVE); // Do trigger a record change. } /**
/** * Called when a new blank record is required for the table/query. * @param bDisplayOption If true, display any changes. */ public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); if (m_bMoveOnNew) { boolean bOldModified = false; if (m_fldDest != null) bOldModified = m_fldDest.isModified(); int iMoveType = DBConstants.INIT_MOVE; // Typically, Don't trigger a record change. if (m_bMoveOnValid) if (m_fldDest != null) if (m_fldDest instanceof ReferenceField) if (((ReferenceField)m_fldDest).getReferenceRecord() != null) if (((ReferenceField)m_fldDest).getReferenceRecord().getCounterField() == m_fldSource) if ((m_fldDest.getRecord().getEditMode() == DBConstants.EDIT_IN_PROGRESS) || (m_fldDest.getRecord().getEditMode() == DBConstants.EDIT_CURRENT)) iMoveType = DBConstants.SCREEN_MOVE; // Special case - clearing a secondary field = YES - modified this.moveTheData(bDisplayOption, iMoveType); if (iMoveType == DBConstants.INIT_MOVE) if (m_fldDest != null) if (bOldModified == false) m_fldDest.setModified(false); } } /**
/** * Called when a new blank record is required for the table/query. * @param bDisplayOption If true, display any changes. */ public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); if (m_bMoveOnNew) { boolean bOldModified = false; if (m_fldDest != null) bOldModified = m_fldDest.isModified(); int iMoveType = DBConstants.INIT_MOVE; // Typically, Don't trigger a record change. if (m_bMoveOnValid) if (m_fldDest != null) if (m_fldDest instanceof ReferenceField) if (((ReferenceField)m_fldDest).getReferenceRecord() != null) if (((ReferenceField)m_fldDest).getReferenceRecord().getCounterField() == m_fldSource) if ((m_fldDest.getRecord().getEditMode() == DBConstants.EDIT_IN_PROGRESS) || (m_fldDest.getRecord().getEditMode() == DBConstants.EDIT_CURRENT)) iMoveType = DBConstants.SCREEN_MOVE; // Special case - clearing a secondary field = YES - modified this.moveTheData(bDisplayOption, iMoveType); if (iMoveType == DBConstants.INIT_MOVE) if (m_fldDest != null) if (bOldModified == false) m_fldDest.setModified(false); } } /**
/** * Called when a new blank record is required for the table/query. * @param bDisplayOption If true, display any changes. */ public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); if (m_bMoveOnNew) { boolean bOldModified = false; if (m_fldDest != null) bOldModified = m_fldDest.isModified(); int iMoveType = DBConstants.INIT_MOVE; // Typically, Don't trigger a record change. if (m_bMoveOnValid) if (m_fldDest != null) if (m_fldDest instanceof ReferenceField) if (((ReferenceField)m_fldDest).getReferenceRecord() != null) if (((ReferenceField)m_fldDest).getReferenceRecord().getCounterField() == m_fldSource) if ((m_fldDest.getRecord().getEditMode() == DBConstants.EDIT_IN_PROGRESS) || (m_fldDest.getRecord().getEditMode() == DBConstants.EDIT_CURRENT)) iMoveType = DBConstants.SCREEN_MOVE; // Special case - clearing a secondary field = YES - modified this.moveTheData(bDisplayOption, iMoveType); if (iMoveType == DBConstants.INIT_MOVE) if (m_fldDest != null) if (bOldModified == false) m_fldDest.setModified(false); } } /**