Changin the Current Record variable in details view

Archived from the Xataface Users forum.

meta — Mon Jun 23, 2008 9:10 am

Hi Steve, hi all,

long time ago I read somewhere in the forum that the Current Record: variable in details view always grabs and displays the first char / varchar / text field of the currently displayed record.

Is there a possibility to change this on a per table basis?

An example: I have a table with customers. It is organized like this:

cust_id (int) (autoincrement) (primary key)

firstname (varchar)

lastname (varchar)

company (varchar)

company_id (int)

[…]

Every time I see a record in details view I will see Current Record: firstname

I would more like to see Current Record: company or even Current Record: company_id

Can I change this somewhere only for that table and not for the whole app?

I am using 1.0-beta-3 now.

Thank you

Markus


shannah — Mon Jun 23, 2008 9:13 am

That can be done with the getTitle() method:

Code: Select all
function getTitle(&$record){     return $record->display('company_id'); }

meta — Tue Jun 24, 2008 5:46 am

shannah wrote:That can be done with the getTitle() method:

Code: Select all
function getTitle(&$record){     return $record->display('company_id'); }

Thank you very much. Works fine

Markus