incoronado
Posts: 12
|
Posted: 11/10/2014, 3:23 PM |
|
I have abstracted the sample code out to reusable function. I have done this with other examples. It renders everything correct except it is not dynamically updating the where on the ListBox object.
Any ideas would be appreciated.
Here's the function that is designed to exclude what has already been selected.
function PopulateLists(& $FormObject, $MasterTable, $MasterID, $LookupTable, $LookupID, $ListObject) {
$DBConnection = null;
$LinkedProject = "";
//Select all projects of the currect user
if (intval(CCGetFromGet($MasterID,0)) > 0) {
//Create a new database connection object
$DBConnection = new clsDBjreapps();
$DBConnection->query("SELECT ".$LookupID." FROM ".$LookupTable." WHERE ".$LookupTable.".".$MasterID."=".$DBConnection->ToSQL(CCGetParam($MasterID,0),ccsInteger));
WriteDebug("SELECT ".$LookupID." FROM ".$LookupTable." WHERE ".$LookupTable.".".$MasterID."=".$DBConnection->ToSQL(CCGetParam($MasterID,0),ccsInteger), 2);
while($DBConnection->next_record()) {
if($LinkedProject != "") {
$LinkedProject .= ",";
}
$LinkedProject .= $DBConnection->f($LookupID);
}
//Destroy the database connection object
$DBConnection->close();
}
//Modify the Where clause of the AvailableListBox List Box
WriteDebug("$LookupID." NOT IN (".$LinkedProject."))",2);
if($LinkedProject != "") {
$FormObject->$ListObject->ds->Where = "$LookupID." NOT IN (".$LinkedProject."))";
//$employees_record->AvailableListBox->ds->Where = "project_id NOT IN (".$LinkedProject.")";
}
}
|
|
|
|