I have some problems with cakephp and dojo.
The problem is that when I access a web page I have no problem seeing
dojo libraries
but when I access it through $ajax->link some modules are not loaded or
not functioning properly.
I guess there must be a problem with rendering and layout.
For example i have the following function in the admins_controller

function view($id)
{
if($id=="test"){
$this->render('test', 'ajax');
}
}

test.thmtl is as follows

<script>
dojo.require("dojo.widget.Checkbox");
dojo.debug("The current version of dojo is: ",
dojo.version.toString());
</script>


<input type="checkbox" name="cb1" id="cb1" dojoType="Checkbox"> normal
checkbox <br>
<?= $ajax->link('link', '/admins/view/test' ,
array('update'=>'c'))?><br><br>

<div id="c">
</div>

and ajax.thmtl layout is


<head>
<?= $html->charsetTag('UTF-8') ?>
<script type="text/javascript">
var djConfig = {isDebug: true};
//djConfig.debugAtAllCosts = true;
</script>
<?= $javascript->link('dojo/dojo.js') ?>
<?= $javascript->link('prototype')?>
<?= $javascript->link('scriptaculous.js?load=effects') ?>
</head>
<?= $content_for_layout ?>

When I access /admins/view/test through my browser the checkbox widget
is shown as meant to
but when I click on the link and the same thing is rendered in the 'c'
div above, the checkbox is a
plain html checkbox.



I must be doing something stupid. I don't know if by rendering in the
same layout
the <?= $javascript->link('dojo/dojo.js') ?> is called again and that's
the problem.
But I have tried calling ajax->link with some other path that renders
in an
empty layout but i have the same problem.

Can please someone reproduce the above example and tell me if he can
fix
the problem


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to