Subject Re: [IBO] FieldsTrimming. (Working with Fields and Parameters)
Author Raymond Kennington
Helen Borrie wrote:
>
> At 04:51 AM 26-10-02 +0930, you wrote:
> >In the tech document "Working with Fields and Parameters":
> >
> >"These settings do not affect values that are stored in teh database
> >tables, i.e. setting
> >a trimming options does not cause the database value to modified."
> >
> >To me this statement implies that if I were to set a field's trimming
> >property to SENTENCE
> >then double-spaces and trailing-spaces would be removed for display
> >purposes only.
> >However, this is not the case. Changes are indeed made in the database.
> >
> >Is this a bug or is documentation incorrect or am I missing something?
>
> You are missing something.
>
> Unless you protect the data-aware controls and/or the dataset columns from
> editing, the behaviour of the datalink (encapsulated in the datasource
> component) in response to certain events, is to take any modified values
> from the control and to update the dataset. Now, if the user happens to
> click into the trimmed field during an edit, the control's image of the
> field's value will get marked as "visited". Subsequent comparison of the
> control's value with the dataset's value will tell the datalink that the
> underlying dataset column has changed and the dataset column will get updated.
>
> IOW, if the whitespace characters are *signficant* in your data, then don't
> use the trimming attributes; or, if you do, then make the fields readonly,
> or intercept the events that update the control or the dataset and revert
> the value. You might be interested to look at the Oldxxxx properties of
> TIB_Row and TIB_Column for some clues as to how to recover the original
> values.
>
> Helen

Thanks.

I ask the following because I need to know if the behaviour is intended behaviour of
IBObjects so that I can count on it future versions.

So does this mean that if the user enters a new record and in one field enters a string
that has spaces (and I want them removed using SENTENCE) then the extra spaces will not be
stored in the database? In other words, editing a field indicates a visit to the field in
the sense you mention above and it is the intended behaviour of IBObjects?

--
Raymond Kennington
Programming Solutions
W2W Team B