Depselect problem

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

Depselect problem

Postby 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
tomtom8
 
Posts: 17
Joined: Mon Jul 30, 2012 6:56 am

Re: Depselect problem

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

1. Set the vocabulary directive of the field to use a valuelist
2. 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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Depselect problem

Postby 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
 
Posts: 17
Joined: Mon Jul 30, 2012 6:56 am

Re: Depselect problem

Postby 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
tomtom8
 
Posts: 17
Joined: Mon Jul 30, 2012 6:56 am


Return to Xataface Users

Who is online

Users browsing this forum: Google [Bot] and 24 guests

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