Generating a value list based on another value list

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

Generating a value list based on another value list

Postby 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
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: Generating a value list based on another value list

Postby 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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Generating a value list based on another value list

Postby 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
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: Generating a value list based on another value list

Postby Monty51 » Tue Nov 06, 2012 12:57 pm

Disregard...I see the news about its availability on SourceForge.
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: Generating a value list based on another value list

Postby 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';
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm

Re: Generating a value list based on another value list

Postby 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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Generating a value list based on another value list

Postby 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 :wink:
Monty51
 
Posts: 15
Joined: Tue Oct 23, 2012 12:40 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

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