The Field has Changed.
@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).
196514
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    { // Read a valid record
        if (this.getOwner().getRecord().getField(m_iMainFilesFieldSeq) instanceof DateTimeField)
        {
            DateTimeField thisField = ((DateTimeField)this.getOwner().getRecord().getField(m_iMainFilesFieldSeq));
            double dDate = 0;
            if (m_bMoveCurrentTime)
                dDate = DateField.currentTime();
            else
                dDate = DateField.todaysDate();
            int iErrorCode = thisField.setValue(dDate, bDisplayOption, iMoveMode);        // File written or updated, set the update date
            if (iMoveMode == DBConstants.INIT_MOVE)
                thisField.setModified(false);   // Don't make this record modified just because I set this field.
            return iErrorCode;
        }
        return DBConstants.NORMAL_RETURN;
    }
1261012
public int moveIt(boolean bDisplayOption, int iMoveMode)
    {
        if (m_bDontMoveNull) if (m_fldSource.getLength() == 0)      // Only move if dest is null
            return DBConstants.NORMAL_RETURN;
        if (m_bClearIfThisNull) if (this.getOwner().getLength() == 0) // If this is null, clear the dest field
            return ((BaseField)m_fldDest.getField()).moveFieldToThis(this.getOwner(), bDisplayOption, iMoveMode); // Move dependent field to here
        if (m_bOnlyIfDestNull) if (m_fldDest.getLength() != 0)      // Only move if dest is null
            return DBConstants.NORMAL_RETURN;
        int iErrorCode = this.moveSourceToDest(bDisplayOption, iMoveMode);
        if (iErrorCode == DBConstants.NORMAL_RETURN) if (m_fldDest == m_fldSource)
            return ((BaseField)m_fldDest.getField()).handleFieldChanged(bDisplayOption, iMoveMode);   // Special case, move to yourself (Just want to call .FieldChanged())
        return iErrorCode;
    }
955266
public int moveIt(boolean bDisplayOption, int iMoveMode)
    {
        ((BaseField)m_fldDest.getField()).setEnabled(!this.getOwner().getState());
        if (iMoveMode != DBConstants.SCREEN_MOVE)
            return DBConstants.NORMAL_RETURN;
        if (this.getOwner().getState() == false)
        {
            if (bDisplayOption)
                ((BaseField)m_fldDest.getField()).displayField();   // Redisplay
            return DBConstants.NORMAL_RETURN;
        }
        else
            return super.moveIt(bDisplayOption, iMoveMode); // Move it!
    }
154211
public void doValidRecord(boolean bDisplayOption)
    {
        if (m_fldMain == null)
            m_fldMain = this.getOwner().getField(mainFieldName);
        if (m_fldMain == null)
            return;     // Error - Field not found?
        if (fileKeyFieldName != null)
            m_FileToRead.getField(fileKeyFieldName).moveFieldToThis(m_fldMain, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);  // SCREEN_MOVE says this is coming from here
        else
            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_FileToRead.getDefaultDisplayFieldName());
                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);
    }
271358
public void doNewRecord(boolean bDisplayOption)
    {
        super.doNewRecord(bDisplayOption);
        BaseField fldTarget = null;
        if (typeFieldName != null)
            fldTarget = this.getOwner().getField(typeFieldName);
        else
            fldTarget = this.getOwner().getField(m_iTypeField);
        boolean[] rgbEnabled = fldTarget.setEnableListeners(false);
        InitOnceFieldHandler listener = (InitOnceFieldHandler)fldTarget.getListener(InitOnceFieldHandler.class.getName());
        if (listener != null)
            listener.setFirstTime(true);    // Special case - you shouldn't have put this listener here, but since you did...
        fldTarget.setValue(m_iTargetValue, DBConstants.DISPLAY, DBConstants.INIT_MOVE);
        fldTarget.setModified(false);
        fldTarget.setEnableListeners(rgbEnabled);
    }
1166621
public int setDateTime(java.util.Date date, boolean bDisplayOption, int iMoveMode)
    {
        if (date == null)
            return this.setData(date, bDisplayOption, iMoveMode);
        m_calendar.setTime(date);
        m_calendar.set(Calendar.HOUR_OF_DAY, DBConstants.HOUR_DATE_ONLY);
        m_calendar.set(Calendar.MINUTE, 0);
        m_calendar.set(Calendar.SECOND, 0);
        m_calendar.set(Calendar.MILLISECOND, 0);
        date = m_calendar.getTime();
        return this.setValue(date.getTime(), bDisplayOption, iMoveMode);
    }
1285318
public int setValue(double value, boolean bDisplayOption, int moveMode)
    {           // Set this field's value
        Short tempshort = new Short((short)value);
        int errorCode = this.setData(tempshort, bDisplayOption, moveMode);
        return errorCode;
    }
1105886
public int setSFieldValue(String strParamValue, boolean bDisplayOption, int iMoveMode)
    {
        if (this.getConverter() != null)
            return this.getConverter().setString(strParamValue, bDisplayOption, iMoveMode);
        else
            return Constant.NORMAL_RETURN;
    }
49492
public int setString(String strValue, boolean bDisplayOption, int iMoveMode)
    {
        if ((strValue == null) || (strValue.length() == 0))
            return super.setString(strValue, bDisplayOption, iMoveMode);  // Don't trip change or display
        if (TEN_SPACES.equals(strValue))
            return DBConstants.NORMAL_RETURN;
        return super.setString(strValue, bDisplayOption, iMoveMode);
    }
785023
public int moveIt(boolean bDisplayOption, int iMoveMode)
    {
        if (m_convCheckMark != null) if (m_convCheckMark.getState() == false)
            return DBConstants.NORMAL_RETURN;       // If check mark is false (or no check mark), don't move
        return super.moveIt(bDisplayOption, iMoveMode);
    }
405998
public int initField(boolean bDisplayOption)                    // Init this field override for other value
    {
        if ((this.getDefault() == null) || (this.getDefault() instanceof String))
            return this.setString((String)this.getDefault(), bDisplayOption, Constants.INIT_MOVE);   // zero out the field
        return this.setData(this.getDefault(), bDisplayOption, Constants.INIT_MOVE);
    }
399406
public int setTime(java.util.Date time, boolean bDisplayOption, int iMoveMode)
    {
        java.util.Date m_DateTime = (java.util.Date)m_data;
        int iYear = DBConstants.FIRST_YEAR;
        int iMonth = DBConstants.FIRST_DAY;
        int iDate = DBConstants.FIRST_MONTH;
        if (m_DateTime != null) //|| (m_CurrentLength == 0))
        {
            m_calendar.setTime(m_DateTime);
            iYear = m_calendar.get(Calendar.YEAR);
            iMonth = m_calendar.get(Calendar.MONTH);
            iDate = m_calendar.get(Calendar.DATE);
        }
        m_calendar.setTime(time);
        int iHour = m_calendar.get(Calendar.HOUR_OF_DAY);
        int iMinute = m_calendar.get(Calendar.MINUTE);
        int iSecond = m_calendar.get(Calendar.SECOND);
        m_calendar.set(iYear, iMonth, iDate, iHour, iMinute, iSecond);
        java.util.Date dateNew = m_calendar.getTime();
        return this.setDateTime(dateNew, bDisplayOption, iMoveMode);
    }
1348914
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        Record record = this.getOwner().getRecord();
        if (record != null)
        {
            try   {
                Object varBookmark = null;
                if (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
                { // Update the record
                    if (m_bRefreshAfterWrite)
                        varBookmark = record.getHandle(DBConstants.DATA_SOURCE_HANDLE);
                    record.set();
                }
                else if (record.getEditMode() == DBConstants.EDIT_ADD)
                {
                    record.add();
                    if (m_bRefreshAfterWrite)
                        varBookmark = record.getLastModified(DBConstants.DATA_SOURCE_HANDLE);
                }
                if (varBookmark != null)
                {
                    record.setHandle(varBookmark, DBConstants.DATA_SOURCE_HANDLE);
                    record.edit();
                }
            } catch (DBException ex)    {
                ex.printStackTrace();
                iErrorCode = ex.getErrorCode();
            }
        }
        return iErrorCode;
    }
226191
public int setValue(double value, boolean bDisplayOption, int iMoveMode)
    {           // Set this field's value
        double dRoundAt = Math.pow(10, m_ibScale);
        Double tempdouble = new Double(Math.floor(value * dRoundAt + 0.5) / dRoundAt);
        int errorCode = this.setData(tempdouble, bDisplayOption, iMoveMode);
        return errorCode;
    }
1328758
public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode)
    {   // User selected an item... Read it in!
        int iErrorCode = this.moveToIndex(index);
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption);   // Record selected!!!
        // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!!
        FieldInfo field = this.getField();
        if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null)
        {
            if (field instanceof ReferenceField)
                ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode);
            else if (field instanceof StringField)
            {
                {
                    if (displayFieldName != null)
                        return field.setString(m_record.getField(displayFieldName).toString());
                    else
                        return field.setString(m_record.getField(m_iFieldSeq).toString());
                }
            }
        }
        return iErrorCode;
    }
30669
public void initRecord(boolean bDisplay) throws DBException
    {
        int iFieldCount = this.getFieldCount();      // Number of fields to read in
        for (int iFieldSeq = Constants.MAIN_FIELD; iFieldSeq < iFieldCount + Constants.MAIN_FIELD; iFieldSeq++)
        {
            FieldInfo field = this.getField(iFieldSeq);
            field.initField(bDisplay);
        }
        this.setEditMode(Constants.EDIT_NONE);
    }
282238
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
    {
        UserField field = (UserField)this.getOwner();
        Person recPerson = (Person)field.getRecord();
        if (field.isNull())
        {
            
        }
        else
        {
            ContactTypeModel recContactType = (ContactTypeModel)this.getContactType(recPerson);
            if (recContactType != null)
            {   // Always
                UserInfo recUserInfo = (UserInfo)field.getReference();
                if (recUserInfo != null)
                    if ((recUserInfo.getEditMode() == DBConstants.EDIT_CURRENT) || (recUserInfo.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
                    {
                        recUserInfo.addPropertyListeners();
                        int iOldOpenMode = recUserInfo.setOpenMode(recUserInfo.getOpenMode() & ~DBConstants.OPEN_READ_ONLY);
                        try {
                            recUserInfo.edit();
                            recUserInfo.getField(UserInfo.CONTACT_TYPE_ID).moveFieldToThis(((Record)recContactType).getCounterField());
                            recUserInfo.getField(UserInfo.CONTACT_ID).moveFieldToThis(recPerson.getCounterField());
                            recUserInfo.set();
                        } catch (DBException ex) {
                            ex.printStackTrace();
                        } finally {
                            recUserInfo.setOpenMode(iOldOpenMode);
                        }
                    }
            }
        }
        return super.fieldChanged(bDisplayOption, iMoveMode);
    }