Generating a value list based on another value list
Archived from the Xataface Users forum.
Monty51 — Tue Nov 06, 2012 7:31 am
I have finally generated two select widgets that are each based on their own SQL query, but I’d like to generate the second widget based on the selection in the first widget, something along the lines of:
[first widget]
__sql__ “SELECT jvm FROM main ORDER BY jvm”
[second widget]
__sql__ “SELECT server FROM main ORDER BY server WHERE jvm = [first widget]”
Is this possible?
Thanks
shannah — Tue Nov 06, 2012 9:08 am
With straight valuelists you would require some custom javascript to stitch them together. I have developed a depselect widget that supports this type of behaviour. It requires Xataface 2.0 though.
You can read more about the depselect module here
http://xataface.com/dox/modules/depselect/latest/
I haven’t produced a zip or tar file for it yet, but you can get it straight from the subversion repository (link is in the docs).
-Steve
Monty51 — Tue Nov 06, 2012 12:55 pm
I confess I’m a bit confused…all I see available for download is 1.3.3. Is 2.0 a beta version?
Monty51 — Tue Nov 06, 2012 12:57 pm
Disregard…I see the news about its availability on SourceForge.
Monty51 — Tue Nov 06, 2012 1:07 pm
sorry to keep pestering, but with the 2.0 version, do I presume correctly that I can install it into the same directory heirarchy as xataface-1.3.2 and then change my applications index.php ‘require_once’ statement to the new directory? I.e.:
require_once ‘/var/www/html/xataface-1.3.2/dataface-public-api.php’;
– to –
require_once ‘/var/www/html/xataface-2.0alpha1/dataface-public-api.php’;
shannah — Tue Nov 06, 2012 1:12 pm
Yes. That should work. Note, that I have removed FCKeditor and TinyMCE from the 2.0 distribution so if you need to use the htmlarea widget type you’d need to copy the lib/FCKeditor directory from 1.3.x into 2.0. The intention is to switch to using the ckeditor module instead though in those cases.
It is also intended that you install the g2 module for the new improved look and feel if you’re in 2.0.
-Steve
Monty51 — Tue Nov 06, 2012 1:17 pm
Thanks, and so noted. I’m nowhere that yet, but I’ll try and remember that when it comes time