I solved my problem by adding this empty option in the server response. And I do not use prompt or empty options of dropDownList
public function actionDynamicVersions() {
$data = AdminVersion::model()->findAll('modele_id=:modele_id',
array(':modele_id'=>(int) $_POST['AdminVoiture']['modele_id']));
$data = CHtml::listData($data,'id','nom');
echo CHtml::tag('option',array('value' => ''),'Choose one version...',true);
foreach($data as $id => $value)
{
echo CHtml::tag('option',array('value' => $id),CHtml::encode($value),true);
}
}
But I have another problem
My dropDownLists are linked (dependent) Update of their content works fine 2 by 2. I mean I update list 1 then list 2 is updated, I updated list 2 then list 3 is correctly updated.
But When I change list 1, then I would appreciate that both list 2 and list 3 are updated (list 3 would contain only the empy option tag…
Then I do not know how to clean up this list 3 when changes occur in the list 1
I just would like to know whether I may use the ajax facilities (I mean the update stuff) embbeded in drodDownList or Shall I program myself the ajax update (meaning populating the differnt list according to my need ( 3 dependent lists ) )