CJuiAutoComplete is not working for me. It appears that my controller action is not being called. The debugger never breaks in the actionLookup function nor does the echo display. Also, I cannot get it to work if I set the source to a simple array of items. What am I doing wrong? Help would be much appreciated.
_form.php
<?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'model' => $model,
'attribute' => 'zipcode',
'source' => $this->createUrl('address/lookup'),
'name' => 'zipcode',
'value' => $model->zipcode,
'htmlOptions' => array('size'=>'5'),
'options' => array(
'showAnim'=>'fold',
'minLength' => 1, // min chars to start search
),
)) ?>
AddressController.php
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update','lookup'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
public function actionLookup()
{
echo "Zipcode Lookup!";
}