/** * Set the record that owns this listener. * If a record is passed in, this method makes sure the correct key area is set on this record. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_iMainField == -1) m_fldMain = this.getOwner().getReferenceField(m_FileToRead); m_FileToRead.setKeyArea(m_FileToRead.getField(m_iFileKeyField)); } } /**
/** * Set the record that owns this listener. * If a record is passed in, this method makes sure the correct key area is set on this record. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_iMainField == -1) m_fldMain = this.getOwner().getReferenceField(m_FileToRead); m_FileToRead.setKeyArea(m_FileToRead.getField(m_iFileKeyField)); } } /**
/** * Set the record that owns this listener. * If a record is passed in, this method makes sure the correct key area is set on this record. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (mainFieldName == null) m_fldMain = this.getOwner().getReferenceField(m_FileToRead); if (fileKeyFieldName != null) m_FileToRead.setKeyArea(m_FileToRead.getField(fileKeyFieldName)); else m_FileToRead.setKeyArea(m_FileToRead.getField(m_iFileKeyField)); } } /**
/** * Called when a valid record is read from the table/query. * Reads the secondary record and set's the record not found message if not found. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { if (m_fldMain == null) m_fldMain = this.getOwner().getField(m_iMainField); if (m_fldMain == null) return; // Error - Field not found? m_FileToRead.getField(m_iFileKeyField).moveFieldToThis(m_fldMain, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // SCREEN_MOVE says this is coming from here try { boolean bSuccess = m_FileToRead.seek("="); if (!bSuccess) { m_FileToRead.initRecord(bDisplayOption); // Put's record in an indeterminate state (so this record won't be written) and clears the fields. BaseField nextField = m_FileToRead.getField(m_iFileKeyField+1); String strRecNotFound = this.getOwner().getTable().getString(RECORD_NOT_FOUND_MESSAGE); if (nextField instanceof StringField) nextField.setString(strRecNotFound, bDisplayOption, DBConstants.SCREEN_MOVE); } } catch (DBException ex) { ex.printStackTrace(); } super.doValidRecord(bDisplayOption); } /**
/** * Called when a valid record is read from the table/query. * Reads the secondary record and set's the record not found message if not found. * @param bDisplayOption If true, display any changes. */ public void doValidRecord(boolean bDisplayOption) { if (m_fldMain == null) m_fldMain = this.getOwner().getField(m_iMainField); if (m_fldMain == null) return; // Error - Field not found? m_FileToRead.getField(m_iFileKeyField).moveFieldToThis(m_fldMain, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // SCREEN_MOVE says this is coming from here try { boolean bSuccess = m_FileToRead.seek("="); if (!bSuccess) { m_FileToRead.initRecord(bDisplayOption); // Put's record in an indeterminate state (so this record won't be written) and clears the fields. BaseField nextField = m_FileToRead.getField(m_iFileKeyField+1); String strRecNotFound = this.getOwner().getTable().getString(RECORD_NOT_FOUND_MESSAGE); if (nextField instanceof StringField) nextField.setString(strRecNotFound, bDisplayOption, DBConstants.SCREEN_MOVE); } } catch (DBException ex) { ex.printStackTrace(); } super.doValidRecord(bDisplayOption); } /**
m_fldMain = this.getOwner().getField(mainFieldName); if (m_fldMain == null) return; // Error - Field not found? String strRecNotFound = this.getOwner().getTable().getString(RECORD_NOT_FOUND_MESSAGE); if (nextField instanceof StringField) nextField.setString(strRecNotFound, bDisplayOption, DBConstants.SCREEN_MOVE);