hello everyone,
my script is not able to update div content using link to remote. below is my
code. please tell me if i miss something.
indexSuccess.php [
<div id="mycart">
<?php include_partial("companyproduct/cart") ?>
</div>
<td>
<?php foreach ($pager as $companyproduct): ?>
<?PHP echo link_to_remote('Add to Cart',
array(
'update' => 'mycart',
'url' =>
'companyproduct/Addtocart?prodid='.$companyproduct->getId(),
'return' => 'true',
'script' => true,
), array('class' => 'ajax_link',
)) ?>
</td>
<?php endforeach; ?>
]
ACTIONS:
executeAddtocart(sfWebRequest $request)[
if($request->isXmlHttpRequest()) {
if($request->getParameter('prodid') &&
is_null($request->getParameter('prodid')) == false)
{
$this->getUser()->addToCart($request->getParameter('prodid'));
return $this->renderPartial('companyproduct/cart');
}
$this->setLayout(false);
}
]
When I check the firebug POST HTML. the return is already updated.
result: YourCartItems(5)
but in my IndexSuccess.php is still YourCartItems(4). I still need to refresh
it in order to view the updated one.
Thank you all.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" 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/symfony-users?hl=en