Article View: borland.public.delphi.database
Article #1979Re: Edited data is copied to the TFields only after exiting a DBEdit - it annoys me
From: Deborah Pate
Date: Sun, 07 Mar 1999 00:00
Date: Sun, 07 Mar 1999 00:00
26 lines
2002 bytes
2002 bytes
[Bart Loosvelt wrote: "Now, suppose you start with an empty DATEFIELD value in your current record. Enter a correct date in the DBEdit, don't press TAB, click the SpeedButton with the mouse. It says that the DATEFIELD is still empty! Click the TButton and it will correctly tell you the value you just entered. Then, press the SpeedButton again and it will suddenly also tell you the correct value. This is because the last edited value is copied to the TField only when the DBEdit looses focus. The SpeedButton cannot get the focus, while the TButton can. ... Maybe I'm weird, but this annoys me. Why can't we have one place where we can retreive the most recent data from, instead we have to - write data in the TFields if we want to modify a record at run time - read the data from the Controls if we want to get the most recent values "] Things like speedbuttons that save resources by not accepting the focus do have certain annoying side effects, one of which is that data-aware controls ignore any clicks on them, since they don't know they should post the data until they lose the focus. However the way to fix it is just to call dataset.post when the speedbutton is clicked - you don't need to read the control's text yourself. Deborah Pate
Technical Details
Message-ID:
<7bud79$9q9$1@news5.svr.pol.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36d2bff1.5296646@news.belgium.eu.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 115d96,34876f1bebd57afc,start X-Google-Attributes: gid115d96,public From: "Deborah Pate" <Debs@djpate.freeserve.co.uk> Subject: Re: Edited data is copied to the TFields only after exiting a DBEdit - it annoys me Date: 1999/03/07 Message-ID: <7bud79$9q9$1@news5.svr.pol.co.uk> X-Deja-AN: 452271031 References: <36d2bff1.5296646@news.belgium.eu.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: abuse@theplanet.net X-Trace: news5.svr.pol.co.uk 920827945 10057 62.136.21.93 (7 Mar 1999 17:32:25 GMT) Organization: Customer of Planet Online NNTP-Posting-Date: 7 Mar 1999 17:32:25 GMT Newsgroups: borland.public.delphi.database