Hello,
I have a small problem but can't figure out what I am doing wrong.
First I have created an Element that call a controllers using
RequestAction :
--------- Element code ------------
<?php $val = $this->requestAction('/subscribers/getOrganizationName/'.
$subId);
$this->log("In element = ".$val);
echo $val;
?>
---------- The controller method -----------------------
function getOrganizationName($subId)
{
$this->autoRender = false;
$data = $this->Subscriber->read(null, $subId);
if(!empty($data))
{
return $data['Subscriber']['organization'];
}
return 'Unknowned';
}
Actually I call this renderElement in a view that is updating a Div
using Ajax
This view is updating 2 div's already updated by another call to a
submit form ..
-------- the view ------------------------ (a part of it)
<?php ajax->div("first_div");
echo $this->renderElement('organization_namefromsub', array(
'subId' => $output['subscriber_id']));
ajax->divEnd("first_div");
ajax->div("second_div");
echo $this->renderElement('organization_namefromsub', array(
'subId' =>
$output['subscriber_id']));
ajax->divEnd("second_div");
WHat is strange is that the first div is correct, the second get the
correct values from the elements but comes up with some warning that
screw up the screen :
Warning: session_start() [function.session-start]: Cannot send session
cookie - headers already sent by (output started at
c:\EasyPHP\www\cake\appb\views\applications\selectprod.thtml:5) in
c:\EasyPHP\www\cake\cake\libs\session.php on line 131
I think I can find a solution, it seems that because the div have been
updated already by another call to ajax->submit( ..
update->array("first_div", "second_div") .. This submit actually render
another view that contains again the 2 divs ..
It seems that because the Element are calling requestAction,somthing is
wrong..(if I set a fix value in the Element instead of the
requestAction, everything is ok..
If someone has faced this problem, maybe just a parameter in the
RequesAction into the Element ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---