Quick add for relationships

Archived from the Xataface Users forum.

jimr451 — Fri Jul 08, 2011 10:37 am

Hi,

I’ve got a relationship set up something like this:

table: Food

table: food_types

In “food_types” is a list like “fruit”,”vegetable”,”protein”,”pasta”, etc.

So, to mark a food as two types, like “fruit”, and “protein”, I need to go to that tab, and add each record individually.

Is there any way to list out the options, like you would with a valuelist?

For legacy purposes, I need to keep the selected values in a separate table. Maybe there is a way to do this with valuelists and a delegate class? If someone could point me in the right direction, I’d appreciate it. Otherwise, I’ll have to stick with the relationship model, which is something I could live with.

-jim


shannah — Sat Jul 09, 2011 8:03 am

Consider using a transient field with a checkbox widget in the parent table:

Code: Select all
[myrelationshipfield] transient=1 relationship=myrelationship widget:type=checkbox

This will add a field to your edit form where each possible related record has a checkbox that you can check.

-Steve


jimr451 — Mon Jul 11, 2011 4:05 am

Ahhh - that’s what I was looking for! Thanks! I love Xataface!

-Jim