Hello all,
I am trying to update the content of a div (details) based on the
article title that was clicked. Below is my code for the view
(test.thtml) and the generated code. The problem is that when I click
on article title, nothing happens. Even the controller function
specified in the ajax-link never gets called. One specific thing that
is bothering me is the event onClick for the link is returning false.
Is that normal ?
regards
=========== test.thml =========
<?php
foreach($articles as $index){
$article = $index['Article'];
?>
<div class="record">
<span class="title">
<?php echo $ajax->link($article['title'],
'/articles/view/'.
$article['id'], array('update' => 'details')); ?>
</span>
</div>
<?php
} // next $articles
?>
<?php e($ajax->div("details")); ?>
<h2><?php $php->array2table($data, true); ?></h2>
<?php e($ajax->divEnd("details")); ?>
========== generate code ============
<div class="record">
<span class="title">
<a href="/cake/articles/view/11" id="link8473" onclick="
return
false;">Article 2</a><script
type="text/javascript">Event.observe('link8473', 'click',
function(event){ new Ajax.Updater('details','/cake/articles/view/11',
{asynchronous:true, evalScripts:true, requestHeaders:['X-Update',
'details']}) }, false);</script> </span>
</div>
<div class="record">
<span class="title">
<a href="/cake/articles/view/10" id="link26078" onclick="
return false;">Semantic Analysis of GIS</a><script
type="text/javascript">Event.observe('link26078', 'click',
function(event){ new Ajax.Updater('details','/cake/articles/view/10',
{asynchronous:true, evalScripts:true, requestHeaders:['X-Update',
'details']}) }, false);</script> </span>
</div>
<div id="details"> <h2><br />
<b>Notice</b>: Undefined variable: data in
<b>C:\Apache2\htdocs\cake\app\views\general\test.thtml</b> on line
<b>18</b><br />
</h2>
</div>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---