Page 1 of 1

PostPosted: Thu Sep 14, 2006 7:25 pm
by cls
Hi all,
hi Steve,

Dataface is a very great tool, I discovered it yesterday and now I'm setting up the backend for a website I'm developing.
I'll try to be brief, but I'm afraid that the question is quite complex... sorry.

The question is: it is possible to have an Add/Edit form with a set of checkboxes related to the records contained in another table?
For example, I have 2 tables: "Articles" and "Categories". Every article can be associated to one or more categories. So, when I insert a new article, I would like to have a checkbox for each item of the Categories table.
I imagine I need a join table, like "Article2Category" where relationships are stored, and I tried also the examples in the documentation Example 2 (Relationships Sections), but unfortunately it doesn't work.

There is a way to get this, or is this a feature not yet supported?

Thanks in advance,
Claudio

PostPosted: Thu Sep 14, 2006 9:59 pm
by shannah
Hi Claudio,

Thanks for trying Dataface and thanks for the question.

Currently this is a point of difficulty... but it is VERY close to being addressed. For now you can sort of do this, but not in the best way, unfortunately.

It is possible to set up a "repeat" field so that the field can store multiple values (one per line). This can simulate what you are looking for as follows:

Add a varchar or text field to the Articles table called 'categories'.
e.g.
categories varchar(32)

In the Articles fields.ini file:

[categories]
widget:type = checkbox
vocabulary = categories

And in the valuelists.ini file:

[categories]
__sql__ = "select category_id, category_name from Categories"

This would result in a set of checkboxes representing the categories in the Categories table to be displayed on the Article form.

Does this suffice?

Best regards

Steve

PostPosted: Fri Sep 15, 2006 2:14 am
by cls
Thanks Steve for your answer.

The final goal for me is to make in the front end a search form (or query-based pages) where I can display Articles related to a given Category. It's a simple thing to do also with the simulation you suggested, so I think that I can use this solution, until the feature will be addressed (how long we have to wait?) :)

Thanks and again: Dataface is very useful.

Bye,
Claudio

PostPosted: Fri Sep 15, 2006 8:57 am
by shannah
until the feature will be addressed (how long we have to wait?) <img src=:)" title="Smile" />



I would expect this to be implemented by the end of the year.