Multiple Select Update Operation

hi to all,

i have just learned how to display saved multiple select values on update operation.








$tselected = explode(",",$model->columnname);


			foreach($tselected as $single)

			{

				 $testsel[$single]   = array("selected"=>"selected");

			}







from the above line columnname have id values like 1,2,3,4…

first i changed string to array. then each array i assign selected option.


echo $form->dropDownList(

					$model,

					'test',

					$testslist,

					array('multiple'=>'multiple',

				    	'key'=>'testid', 'class'=>'multiselect','options'=>$testsel)

				); 



finally create option parameter and pass array values