Board index » jbuilder » When is QueryDataSet data loaded into a JdbTable?

When is QueryDataSet data loaded into a JdbTable?


2003-11-03 12:40:36 AM
jbuilder7
(Newcomer to JBuilder/DataExpress etc. alert...)
I have a simple set of data from a QueryDataSet populating a JdbTable.
It all loads and displays as expected.
Problem:
The data is date related, one row per day. On load, I'd like
to selected the row pertaining to the current date. After some casting
about, I thought a LoadListener would do the trick. But no; the data
has (I suppose) been loaded by it isn't in the table data model at that
time. I also tried a TableModelListener, but that never seems to fire
(I presume it fires if a user updates the table).
I'm sure I'm missing something simple. How can I jump in and set an
initial row selection once the table is loaded?
All clues gratefully received. TIA.
--
Jim Hague - XXXX@XXXXX.COM Never trust a computer you can't lift.
 
 

Re:When is QueryDataSet data loaded into a JdbTable?

In article < XXXX@XXXXX.COM >,
Jim Hague < XXXX@XXXXX.COM >wrote:
Quote
The data is date related, one row per day. On load, I'd like
to selected the row pertaining to the current date. After some casting
about, I thought a LoadListener would do the trick. But no; the data
has (I suppose) been loaded by it isn't in the table data model at that
time. I also tried a TableModelListener, but that never seems to fire
(I presume it fires if a user updates the table).

I'm sure I'm missing something simple. How can I jump in and set an
initial row selection once the table is loaded?
For the record, a quick summary of what I've done. First off, my attempts
at adding a TableModelListener failed because I wasn't explicitly allocating
my own DBTableModel, and so the JdbTable was creating a new one after
I'd added the listener (and thus the listener got lost).
So, when I get a tableChanged event, I'm now recalculating the required
highlight row and setting the highlight. But it seems timing dependent as
to whether this happens before or after a point in the query where the
query decides that since the table has change it had better reset the
selection. So I'm setting the selection to the highlight row after the
query as well, just to make sure.
--
Jim Hague - XXXX@XXXXX.COM Never trust a computer you can't lift.