Ok so I was missing a View for the function which was handling the AJAX request, by simply creating a View ajax_populate.ctp for the function ajax_populate() in the controller I was able to retreive the data from that view and work with it further:
Controller:
public function ajax_populate() {
$this->layout = 'ajax';
$data = $this->Domain->HostingAccount->HostPackage->find('list',array('conditions' => array(
'HostPackage.host_id' => $this->data['Domain']['host_id'])));
$this->set('options', $data);
}
View:
<?php
echo "<div><select>";
foreach($options as $key => $val){
echo "<option value='$key'>$val</option>";
}
echo "</select></div>";
Original View (from which the ajax is called):
echo $this->Js->get('#DomainHostId')->event('change',$this->Js->request('ajax_populate',
array('method' => 'POST',
'async' => true,
'update' => '#host_packages',
'dataExpression' => true,
'data'=> $this->Js->serializeForm(array(
'isForm' => true,
'inline' => true
))
//'evalScripts' => true
)));
?>
HTML: (div)
<div id="host_packages"></div>