How to retrieve a value from Cautocomplete textfield in portlet and access it in controller,
I have a Portlet , and there i have used CAutocomplete widget to retieve the supplier list, now when the user selects a specific supplier from widget, then the id is retrieved in a texfield , my query is how to pass or access this id in controller or set this id in session
Below is my Cautocomplete code
<?php $form=$this->beginWidget(‘CActiveForm’, array(
'action'=>Yii::app()->createUrl('/purchaseorder/create'),
'method'=>'post',
));
?>
<?php echo ‘Select Supplier’;
$this->widget(‘CAutoComplete’,
array(
//name of the html field that will be generated
'name'=>'sup_name',
//replace controller/action with real ids
'url'=>array('shoppingCart/AutoCompleteLookupsup'),
'max'=>10, //specifies the max number of items to display
//specifies the number of chars that must be entered
//before autocomplete initiates a lookup
'minChars'=>1,
'delay'=>100, //number of milliseconds before lookup occurs
'matchCase'=>false, //match case when performing a lookup?
//any additional html attributes that go inside of
//the input field can be defined here
'htmlOptions'=>array('size'=>'20','select' => 'js:function(event, item){ $(this).parents("form").submit(); }','tabindex'=>'1'),
'methodChain'=>".result(function(event,item){\$(\"#sup_id\").val(item[1]);})",
));
echo CHtml::textField('sup_id');
?>
<?php $this->endWidget();