multiselect problem

Hello there, I seem to be having a bit of trouble with the multiselect control. I can get the list of checkboxes to show up correctly… but I can click on them all I want, it doesn’t do anything in the database when I save. Essentially, I have three tables organized like this:

tblEmployees -------> tblpmcc <--------------------- tblpmtodo

Server-side, here’s what I’m doing:

require_once('js/scheduler/codebase/connector/scheduler_connector.php');
	require_once('js/scheduler/codebase/connector/crosslink_connector.php');
	
	include ('include/connect.php');
	//include ('../../common/config.php');
	
	//$res=mysql_connect($server, $user, $pass);
	//$res=mysql_connect("localhost", "root", "flex2010");
	//mysql_select_db("flexgroup");
	$sqlEmployes = "SELECT NoPersonne as value, NomPersonne as label FROM tblcartetempspersonnes where Statut = 1 order by NomPersonne asc";
	$sqlClients = "SELECT NoClient as value, NomClient as label FROM tblcartetempsclients where Statut = 1 order by NomClient asc";
	$sqlDivisions = "select 0 as value, '' as label from tblcartetempsdivisions where 1 union SELECT NoDivision as value, NomDivision as label FROM tblcartetempsdivisions order by label asc";

	$cross = new CrossOptionsConnector($conn);
	$scheduler = new schedulerConnector($conn);
	$listeEmployes = new OptionsConnector($conn);
	$listeClients = new OptionsConnector($conn);
	$listeDivisions = new OptionsConnector($conn);

	$listeEmployes->render_sql($sqlEmployes, "NoPersonne", "NoPersonne(value),NomPersonne(label)");
	$listeClients->render_sql($sqlClients, "NoClient", "NoClient(value), NomClient(label)");
	$listeDivisions->render_sql($sqlDivisions, "NoDivision", "NoDivision(value), NomDivision(label)");
	$cross->options->render_sql($sqlEmployes,"NoPersonne","NoPersonne(value),NomPersonne(label)");
	$cross->link->render_table("tblpmcc","CCId", "CCNoPersonne,TodoId2");
	
	$scheduler->set_encoding("iso-8859-1");
	//$scheduler->enable_log("log.txt",true);
	$scheduler->set_options("listeEmployes", $listeEmployes);
	$scheduler->set_options("listeClients", $listeClients);
	$scheduler->set_options("listeDivisions", $listeDivisions);
	$scheduler->set_options("listeCC", $cross->options);
	$scheduler->render_table("tblpmtodo","TodoId","StartDateTime,EndDateTime,Etiquette,Description,ANoPersonne,DeNoPersonne,NoClient,NoDivision");

And, of course, client-side, here’s what I’m doing:


<script type="text/javascript" charset="utf-8">
	function init() {
		var sections = scheduler.serverList("listeEmployes");
		/*var sections=[
			{key:64, label:"Tobbi Filteau"},
			{key:69, label:"Étienne Gamache"}
			//{key:3, label:"Section C"},
			//{key:4, label:"Section D"}
		];*/

		scheduler.locale.labels.employe_tab = "Employés";
		scheduler.locale.labels.day_tab = "Jour";
		scheduler.locale.labels.week_tab = "Semaine";
		scheduler.locale.labels.month_tab = "Mois";
		scheduler.locale.labels.today_button = "Aujourd'hui";
		scheduler.locale.labels.section_empDest="À";
		scheduler.locale.labels.section_empOrigine="De";
		scheduler.locale.labels.section_empCC="CC";
		scheduler.locale.labels.section_Client="Client";
		scheduler.locale.labels.section_Division="Division";
		scheduler.locale.labels.section_time="Durée";
		scheduler.config.details_on_create=true;
		scheduler.config.details_on_dblclick=true;

		
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.config.prevent_cache = true;
		scheduler.config.first_hour=8;
		//scheduler.locale.labels.section_type = "Personne";
		//
		scheduler.config.lightbox.sections=[	
			{name:"description", height:72, map_to:"Description", type:"textarea" , focus:true},
			//{name:"etiquette", height:43, type:"textarea", map_to:"Etiquette"},
			{name:"empDest", height:21, type:"select", map_to:"ANoPersonne", options:scheduler.serverList("listeEmployes")},
			{name:"empOrigine", height:21, type:"select", map_to:"DeNoPersonne", options:scheduler.serverList("listeEmployes")},
			{name:"empCC", height:72, type:"multiselect", map_to:"TodoId2", options:scheduler.serverList("listeCC"), script_url:"calendrierConnecteur.php", vertical:"false"},
			{name:"Client", height:21, type:"select", map_to:"NoClient", options:scheduler.serverList("listeClients")},
			{name:"Division", height:21, type:"select", map_to:"NoDivision", options:scheduler.serverList("listeDivisions")},
			{name:"time", height:72, type:"time", map_to:"auto"}
		]
		
		scheduler.createUnitsView({
			name:"employe",
			property:"ANoPersonne",
			list:sections
		});
		
		//scheduler.locale.labels.section_personne="Personne";
		//scheduler.locale.labels.section_etiquette="Titre";
		//scheduler.config.details_on_create=true;
		//scheduler.config.details_on_dblclick=true;
		scheduler.config.multi_day = true;
		scheduler.init('scheduler_here',new Date(2010,09,27),"employe");
		//scheduler.setLoadMode("month")
		scheduler.load("calendrierConnecteur.php");
		
		var dp = new dataProcessor("calendrierConnecteur.php");
		dp.enableUTFencoding(false);
		dp.init(scheduler);

	}
</script>

Can anyone tell me what’s wrong? Unless I misunderstood the purpose of the CrossOptionsConnector, I would have expected some lines to appear in tblpmcc if I check one of the options shown by my multiselect control, but right now it stays hopelessly blank.

Thanks in advance

Hello,

$cross->link->render_table("tblpmcc","CCId", "CCNoPersonne,TodoId2");

change to

$cross->link->render_table("tblpmcc","TodoId2", "CCNoPersonne,TodoId2");
  1. If it doesn’t help please edit your server-side, add:
$scheduler->enable_log("events_multi_log.txt",true);

Open scheduler again, create new event with some options selected.
Then please attach log content here.

Best regards,
Ilya

I did the suggested changes, but to no effect. When I activated the log, here’s what I got:

I assume the “incorrect field name” has something to do with the problem I’m encountering, but I don’t see where there was even an attempt at inserting into tblpmcc. For reference, here’s the exact list of fields present into each table.

tblemployees:
NoPersonne //actual primary key
CodePersonne
NomPersonne
Type
Statut
Username
Password
Access

tblpmcc:
CCId //actual primary key
TodoId //made the corresponding changes to the code to fetch it
CCNoPersonne
CCDroitPersonne

tblpmtodo
TodoId //actual primary key
NoClient
NoDivision
Description
Etiquette
Notes
StartDateTime
EndDateTime
Priorite
ANoPersonne
ADroitPersonne
DeNoPersonne
Reminder
ReminderDateTime
StatutId
PrcComplete
CalendrierStrategique

Okay, I got it to work thanks to the log. I had to rename the CCNoPersonne to just NoPersonne and change the map_to statement to map_to:“NoPersonne” and it’s finally inserting correctly.

Thanks for your help and quick response again :slight_smile: