TsDBCalcEdit not reflecting fields value!!

Viewing 5 posts - 21 through 25 (of 25 total)
  • Author
    Posts
  • #69732
    HeDiBo
    Participant

    Don’t get mad. Just trying to formulate the cause of action.
    If the OnExit occurs, the user has been in the control. Therefore it stands to reason to check the fields validity then. Even if modified is False.
    Changing Modified to True when a new record is inserted is definitely wrong. Records may stem from different sources. The values of the fields may be well be beyond their min/max values.

    For instance, the program may show the user a list of records where the values are wrong, with the purpose of letting him change the values to valid ones. Therefore the situation in the attached GIF should not be possible: the first time the user entered a wrong value, he got an error message. Then just Tabbing outside the TsDBCalcEdit control with the wrong value was possible. Why was this possible? Because the user did not modify anything, so Modified was False. That situation should not be possible. So, I suggested to check the min/max values in an overridden DoExit procedure.

    Attachments:
    You must be logged in to view attached files.
    #69735
    Support
    Keymaster

    I’m not mad :D, just trying to find a best solution for this situation.
    Now, I have added checking of the dsInsert state and CheckValue is runned in the OnExit if DataSource.State is dsInsert. I hope, this way will be handy for developers.

    #69736
    HeDiBo
    Participant

    Change that in DataSource.State <> dsBrowse, that catches the edits too.

    #69737
    Support
    Keymaster

    Which purpose of the Modified property in this case?
    This property will be unused.

    #69740
    HeDiBo
    Participant

    Have a look at the GIF.
    The value in Min/Max is 1000 – 20000. The first time the user tries to change the value to 400 the OnValidateError is thrown. The dataset stays in dsEdit mode. Then the user tabs out of the edit field: no OnValidateError any more.

    Attachments:
    You must be logged in to view attached files.
Viewing 5 posts - 21 through 25 (of 25 total)
  • You must be logged in to reply to this topic.