public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        if (m_bUpdateRecord)
            if (m_record.isModified())
        {
            try
            {
                if (m_record.getEditMode() == Constants.EDIT_IN_PROGRESS)
                    m_record.set();
                else if (m_record.getEditMode() == Constants.EDIT_ADD)
                    m_record.add();
            }
            catch( DBException ex )
            {
                return ex.getErrorCode();
            }
        }
        if (m_bMoveBehavior) if (m_keyField != null)
            if ((iMoveMode == DBConstants.INIT_MOVE) || (iMoveMode == DBConstants.READ_MOVE))
                m_keyField.setModified(true);   // Force re-read and GetValid/GetNew listener to run
        if (m_keyField == null)
        {
            int iHandleType = DBConstants.BOOKMARK_HANDLE;
            iErrorCode = DBConstants.NORMAL_RETURN;
            try
            {
                Object handle = this.getOwner().getData();
                if ((handle == null)
                    || ((this.getOwner() instanceof ReferenceField) && (((Integer)handle).intValue() == 0)))
                {
                    if ((m_bAllowNull) || (iMoveMode != DBConstants.SCREEN_MOVE))
                        m_record.handleNewRecord(DBConstants.DISPLAY);      //? Display Fields (Should leave record in an indeterminate state!)
                    else
                        iErrorCode = DBConstants.KEY_NOT_FOUND;   // Can't have a null value
                }
                else
                {
                    if (m_record.setHandle(handle, iHandleType) == null) // SCREEN_MOVE says this is coming from here
                        iErrorCode = DBConstants.KEY_NOT_FOUND;
                    else // Do all the field behaviors for the secondary record //x if (iMoveMode != DBConstants.READ_MOVE)
                    {
                        for (int i = 0; i < m_record.getFieldCount(); i++)
                        {
                            m_record.getField(i).handleFieldChanged(bDisplayOption, DBConstants.READ_MOVE);        // Make sure all fields of the secondary record get this change notification
                        }
                    }
                }
            } catch (DBException ex)    {
                iErrorCode = ex.getErrorCode();
            }
        }
        else
            iErrorCode = m_keyField.moveFieldToThis(this.getOwner(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);   // SCREEN_MOVE says this is coming from here
        return iErrorCode;
    }
public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { int iErrorCode = DBConstants . NORMAL_RETURN ; if ( m_bUpdateRecord ) if ( m_record . isModified ( ) ) { try { if ( m_record . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) m_record . set ( ) ; else if ( m_record . getEditMode ( ) == Constants . EDIT_ADD ) m_record . add ( ) ; } catch ( DBException ex ) { return ex . getErrorCode ( ) ; } } if ( m_bMoveBehavior ) if ( m_keyField != null ) if ( ( iMoveMode == DBConstants . INIT_MOVE ) || ( iMoveMode == DBConstants . READ_MOVE ) ) m_keyField . setModified ( true ) ; if ( m_keyField == null ) { int iHandleType = DBConstants . BOOKMARK_HANDLE ; iErrorCode = DBConstants . NORMAL_RETURN ; try { Object handle = this . getOwner ( ) . getData ( ) ; if ( ( handle == null ) || ( ( this . getOwner ( ) instanceof ReferenceField ) && ( ( ( Integer ) handle ) . intValue ( ) == 0 ) ) ) { if ( ( m_bAllowNull ) || ( iMoveMode != DBConstants . SCREEN_MOVE ) ) m_record . handleNewRecord ( DBConstants . DISPLAY ) ; else iErrorCode = DBConstants . KEY_NOT_FOUND ; } else { if ( m_record . setHandle ( handle , iHandleType ) == null ) iErrorCode = DBConstants . KEY_NOT_FOUND ; else { for ( int i = 0 ; i < m_record . getFieldCount ( ) ; i ++ ) { m_record . getField ( i ) . handleFieldChanged ( bDisplayOption , DBConstants . READ_MOVE ) ; } } } } catch ( DBException ex ) { iErrorCode = ex . getErrorCode ( ) ; } } else iErrorCode = m_keyField . moveFieldToThis ( this . getOwner ( ) , DBConstants . DISPLAY , DBConstants . SCREEN_MOVE ) ; return iErrorCode ; }
The Field has Changed.
Read the secondary file.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay).
Key field changed, read the new secondary record.