Mailingliste - Einträge 2005


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] How to identify a row of a table by the values of more than one column ?


  • Subject: Re: [qftestJUI] How to identify a row of a table by the values of more than one column ?
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Thu, 13 Oct 2005 09:02:02 -0000

Hi Philippe,

"Philippe Gaudin" <Philippe.Gaudin@?.com> writes:

>    Hi !
>
>    I have an application using a lot of tables... and I would like to be
>    able to check the values of cells on these tables.
>
>
>    My problem is to identify the row of the table in a way which is
>    independent of the order of the rows.
>
>
>    What I need is to be able to identify a row by the values of some
>    primary key columns.

If you have a primary key column the standard way is to first use a
"Fetch index" node to retrieve the index of the row based on the key
column, then work with that row index in the other rows.

>    Can I write a "table row" resolver returning the text or feature for
>    that row as the concat of the PK row values ?

Yes, and that's actually a very good idea because it will make your
life a lot easier. This is how qftest's TreeTable support works. All
row indices are mapped to the index of the tree node in the first column.


>    Is it possbile ? How ?

Register an ItemNameResolver on JTable (or better yet your specific
table). Implement the getItemName(object, primary, secondary) method
to check for the correct type of table. Completely ignore the primary
parameter - you don't care which column qftestJUI is currently working
on. Instead, simply return the key identifier for the row identified
by the secondary parameter.

Should work like a charm :-)

Please post your results, this should be a tremendously useful
near-generic paradigm. I think it would be possible to provide a class
that implements ItemNameResolver based on this paradigm and that could
be instantiated by simply passing the key column(s) to its
constructor.

Best regards,
    Greg


>    Thanks in advance for your help !
>
>    Philippe

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen