conditional valuelist problem

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

conditional valuelist problem

Postby ststoddard » Tue Nov 03, 2009 11:44 am

Hi,

I am using the valuelist function in delegate classes to generate valuelists that are conditional to the related record from whence one is entering data.

This works great for data entry. But it wreaks havoc on find and update functions. Is there a way to limit the conditional value list to only function when looking at a 'new related record' form, or something to that effect?

Thanks.
S. T. Stoddard
ststoddard
 
Posts: 56
Joined: Mon Nov 05, 2007 4:10 pm
Location: Davis, CA

Postby shannah » Tue Nov 03, 2009 5:54 pm

Code: Select all
function valuelist__mylist(){
    $query =& Dataface_Application::getInstance()->getQuery();
    if ( $query['-action'] == 'new' or $query['-action'] == 'new_related_record' or $query['-action'] == 'edit' ){

         // do my filtered list
    } else {

        // do the full list.
    }
}



There are other ways to achieve what you want here, such as using javascript to filter the values instead of doing at the valuelist level; or creating a grafted field via the __sql__ directive in the fields.ini file that contains the field value and use that as your show piece in list view.

There are probably 10 other ways also.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 12 guests

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