lookup widget search

A place for users and developers of the Xataface to discuss and receive support.

lookup widget search

Postby 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
omills
 
Posts: 18
Joined: Sat Nov 07, 2009 11:01 am

Re: lookup widget search

Postby 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"

...
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved