lookup widget search

Archived from the Xataface Users forum.

omills — Sun Jun 20, 2010 5:53 pm

Hi,

Very much related to this question (http://xataface.com/forum/viewtopic.php?f=4&t=5356&start=0), I have the following setup and need advice:

Table “People”
ID
FirstName
Surname

Table “Donors”
ID
PeopleID (from People table)
Donorinfo

Table “Donations”
ID
DonorID (from Donor table) - the
Amount

fields.ini in Donations Folder:

[DonorID]
widget:label = “Donor”
widget:table = Donors
widget:type = lookup

When adding a donation, with the first field (DonorID) the user searches for an existing Donor using the lookup Widget, but the lookup widget’s search/filter looks for any data in the widget:table (in this case the Donors table)… The list diplays nicely as per the DonorID__renderCell …. but the filter applies to the actual data in the table, not the rendered display data (and the name and surname of the donor is only found in the People table not in the Donor table). How can I get around this?

One thing I tried was using a SQL view similar to what is described as per above… this works fine except when I “Add New” from the lookup widget I get the view table fields, instead of the Donor table fields. I would rather not create a view for this, because I have similar structures with other table sets.

Thanks!

Olivier


shannah — Mon Jun 21, 2010 10:49 am

Rather than use a view, you could just add a grafted field onto the Donor table with the donor name. e.g. In the Donors fields.ini file:

Code: Select all
`sql = “select d.*, p.Name from Donors d left join People p on d.PersonID=p.PersonID”

…`