/** * SelectOnUpdateHandler - Constructor. * @param recordToSync The record to synchronize with this one. * @param bUpdateOnSelect If true, update or add a record in progress before syncing this record. */ public RequeryOnUpdateHandler(Record recordToSync) { this(); this.init(null, recordToSync); } /**
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. * Synchronize records after a dovalid. */ public void doValidRecord(boolean bDisplayOption) { // Sync on a read also super.doValidRecord(bDisplayOption); this.syncRecords(); } /**
/** * SyncRecords - Synchronize the records to the same row. * @return an error code. */ public int syncRecords() { // Read a valid record if ((this.getOwner().getOpenMode() & DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE) == DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE) return DBConstants.NORMAL_RETURN; // Don't need to resync if I'm doing a write and refresh. m_recordToSync.close(); return DBConstants.NORMAL_RETURN; } }
recBooking.addListener(new RequeryOnUpdateHandler(this.getRecord(BookingDetail.BOOKING_DETAIL_FILE)));
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. * Synchronize records after a dovalid. */ public void doValidRecord(boolean bDisplayOption) { // Sync on a read also super.doValidRecord(bDisplayOption); this.syncRecords(); } /**
/** * SyncRecords - Synchronize the records to the same row. * @return an error code. */ public int syncRecords() { // Read a valid record if ((this.getOwner().getOpenMode() & DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE) == DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE) return DBConstants.NORMAL_RETURN; // Don't need to resync if I'm doing a write and refresh. m_recordToSync.close(); return DBConstants.NORMAL_RETURN; } }
/** * Called when a valid record is read from the table/query. * @param bDisplayOption If true, display any changes. * Synchronize records after a dovalid. */ public void doValidRecord(boolean bDisplayOption) { // Sync on a read also super.doValidRecord(bDisplayOption); this.syncRecords(); } /**
/** * SyncRecords - Synchronize the records to the same row. * @return an error code. */ public int syncRecords() { // Read a valid record if ((this.getOwner().getOpenMode() & DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE) == DBConstants.OPEN_DONT_CHANGE_CURRENT_LOCK_TYPE) return DBConstants.NORMAL_RETURN; // Don't need to resync if I'm doing a write and refresh. m_recordToSync.close(); return DBConstants.NORMAL_RETURN; } }
/** * SelectOnUpdateHandler - Constructor. * @param recordToSync The record to synchronize with this one. * @param bUpdateOnSelect If true, update or add a record in progress before syncing this record. */ public RequeryOnUpdateHandler(Record recordToSync) { this(); this.init(null, recordToSync); } /**
/** * Called when a change is the record status is about to happen/has happened. * @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. * Synchronize records after an update or add. */ 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.AFTER_UPDATE_TYPE) || (iChangeType == DBConstants.AFTER_ADD_TYPE)) return this.syncRecords(); return iErrorCode; } /**
/** * SelectOnUpdateHandler - Constructor. * @param recordToSync The record to synchronize with this one. * @param bUpdateOnSelect If true, update or add a record in progress before syncing this record. */ public RequeryOnUpdateHandler(Record recordToSync) { this(); this.init(null, recordToSync); } /**
/** * Called when a change is the record status is about to happen/has happened. * @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. * Synchronize records after an update or add. */ 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.AFTER_UPDATE_TYPE) || (iChangeType == DBConstants.AFTER_ADD_TYPE)) return this.syncRecords(); return iErrorCode; } /**
/** * Called when a change is the record status is about to happen/has happened. * @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. * Synchronize records after an update or add. */ 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.AFTER_UPDATE_TYPE) || (iChangeType == DBConstants.AFTER_ADD_TYPE)) return this.syncRecords(); return iErrorCode; } /**