Depselect problem
Archived from the Xataface Users forum.
tomtom8 — Tue Aug 21, 2012 9:47 am
Hello
I have installed module depselect and I configured my dependent fields as readme file
- Code: Select all
[country_id] widget:type=depselect widget:table=countries [province_id] widget:type=depselect widget:table=provinces widget:filters:country_id="$country_id" [city_id] widget:type=depselect widget:table=cities widget:filters:province_id="$province_id"
and works well in the form, but when I save only see the id in detail view. What’s wrong?
My xataface version is 1.5 2734
Thanks
Michele
shannah — Tue Aug 21, 2012 11:50 am
The depselect widget doesn’t use a valuelist like a regular select widget. If you want the value to be displayed in details/list view there are two ways:
- Set the vocabulary directive of the field to use a valuelist
- Create a grafted field that contains the value.
Option 1 is fine in most cases. The only time you may not want to use a valuelist is when the valuelist would be quite large (because a valuelist is loaded completely during each request. If it would have thousands of values, this would affect performance).
-Steve
tomtom8 — Thu Aug 23, 2012 6:55 am
Ok thanks I thought to do everything with only depselect form. It is then that by implementing the vocabulary with valuelist I do not play the dependencies? I’ll try one of the two recommended methods.
tomtom8 — Thu Aug 23, 2012 8:10 am
Ok I tried the second method:
I have a table magazzino with:
fields.ini
- Code: Select all
- `[id_pacco_myskyhd]
visibility:browse=hidden
visibility:list=hidden
widget:type=depselect
widget:table=pacco_myskyhd
[id_decoder_myskyhd]
visibility:browse=hidden
visibility:list=hidden
widget:type=depselect
widget:table=decoder_myskyhd
widget:filters:id_pacco_myskyhd=”$id_pacco_myskyhd”
[id_dk_myskyhd]
visibility:browse=hidden
visibility:list=hidden
widget:type=depselect
widget:table=dk_myskyhd
widget:filters:id_decoder_myskyhd=”$id_decoder_myskyhd”[pacco_myskyhd]
widget:label = Matricola Pacco MYSKYHD
sql = “select * matr_pacco_myskyhd as pacco_myskyhd from pacco_myskyhd where id_pacco_myskyhd=’$id_pacco_myskyhd’”[decoder_myskyhd]
widget:label = Matricola Decoder MYSKYHD
sql = “select * matr_decoder_myskyhd as decoder_myskyhd from decoder_myskyhd where id_pacco_myskyhd=’$id_pacco_myskyhd’”[dk_myskyhd]
widget:label = Matricola DK MYSKYHD
sql = “select * matr_dk_myskyhd as dk_myskyhd from dk_myskyhd where id_decoder_myskyhd=’$id_decoder_myskyhd’”`
but I have no field grafted in table magazzino