Hi group!
After reading many pages and this group I'm not able to find my bug,
why my result of the autocomplete-request is not shown on my page.
Here's what I have so far:
controller:
--------------
class RadacctsController extends AppController {
var $name = 'Radaccts';
var $helpers = array('Html', 'Form', ''Ajax', 'Number', 'Time');
var $uses = array('Radacct', 'Radcheck');
....
function autoComplete(){
$this->set('results', $this->Radcheck->find('all', array(
'conditions' => array(
'Radcheck.UserName LIKE' => $this->data['Radacct']
['Username'].'%',
),
'limit' => '15',
'fields' => array('username')
)));
$this->layout = 'ajax';
}
my view "index.ctp"
----------------------------
<div class="radaccts form">
<?php
echo $javascript->link('scriptaculous-1.8.3/lib/prototype');
echo $javascript->link('scriptaculous-1.8.3/src/scriptaculous');
echo $ajax->form(array(
'type' => 'post',
'options' => array(
'update'=>'login_liste',
'url' => array(
'controller' => 'radaccts',
'action' => 'autoComplete'
)
)
)
);
echo $ajax->autoComplete('Radacct.Username', '/radaccts/
autoComplete');
echo $form->end('Show logins');
echo $ajax->div('login_liste');
?>
</div>
and my view auto_complete.ctp
---------------------------------------------
<?php //pr($this->params); ?>
<ul>
<?php foreach($results as $result): ?>
<li><?php echo $result['Radcheck']['username']; ?></li>
<?php endforeach; ?>
</ul>
What is strange is, I have to press the "submit"-button to get the
request sent. In the wireshark-trace I see the request and afterwards
the result "<ul><li>my results</li></ul>.
So were is the but to have shown my results under the input-field?
Thanks for your help
Oliver
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en