relationships or valuelists?

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

relationships or valuelists?

Postby Sly » Tue Aug 04, 2009 2:41 am

Hi there,

Xataface is a very nice framework :)
I'm kind of a newbie here, so this question might sound stupid but here it is:

- I have a "products" table, which has fileds like "id", "name", and many subproducts ids like "subProduct1Id", subProduct2ID", etc...
- Then, I have one table for each subProduct, which contains fields like "id", "name, etc...
- Each product has one unique set of each subProduct (i.e. it has only one subProduct1, only one subProduct2, etc...). So it's not the same use case as the "Program / Courses" example in the tutorial, when a program has several courses.

What I would like to do is: when I try to create a new product, it directly grabs SQL data for each subProduct, and displays it using SELECT lists.

Problems / questions I have:
- I am able to display the different SELECTs for each subProduct, using fileds.ini & valuelists.ini, but in that case, the "name" value is displayed in the SELECT (this is ok), but in the end it is the "name" value that is stored into the database, instead of the "id" of each subProduct. Can I change that?
- Should I use relationships to avoid problem above? In that case, can you provide some guidance on how to accomplish this?

thanks a lot
[/b][/list]
Sly
 
Posts: 7
Joined: Wed Aug 27, 2008 2:27 am
Location: Toulouse, France

Re: relationships or valuelists?

Postby Sly » Tue Aug 04, 2009 5:28 am

Sly wrote:- I am able to display the different SELECTs for each subProduct, using fileds.ini & valuelists.ini, but in that case, the "name" value is displayed in the SELECT (this is ok), but in the end it is the "name" value that is stored into the database, instead of the "id" of each subProduct. Can I change that?


Seems that ID value is automatically stored in the database, so should work fine. In that case, not sure I really need relationships at all...
Sly
 
Posts: 7
Joined: Wed Aug 27, 2008 2:27 am
Location: Toulouse, France


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 24 guests

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