On Sun, Oct 10, 2010 at 7:24 AM, Tomfox Wiranata
<[email protected]> wrote:
> Hi,
>
> this process is about editing a product page that the user created.
>
> to enable editing I provide a url and pass the id of that product to
> my controlllers "edit" function, so cake knows what product data to
> retrieve:
>
> link in my view:
> echo $html->image("icons/edit.gif", array(
>                                "alt" => "edit",
>                                'url' => array('controller' => 'products', 
> 'action' => 'edit',
> $product[Product][id])
>                                ));
>
> controller function:
>    function edit()
>    {
>        $this->Product->id = 66;
>        $this->set('myproduct', $this->Product->read());
>    }
>
> now in my "edit.ctp" view i can retrieve the data from the database of
> that product, because i passed the id.
>
>
> BUT JQuery wont work then. for example:
>
> images dont get rendered anymore in my edit.ctp view. this one I use
> to open a css popup. i dont see the icon, but there is still a link.
>                    <a id="icon" href="#?w=500" rel="popup_title"><img
> src="../img/icons/add.png" /></a>

What do images have to do with JQuery?

> OR
> calling a controllers function with jquery doesnt work anymore
>                  $('#title_content').load('processtitle', {data:
> title_content}).fadeIn('slow');

Does AJAX figure into this somehow? If so:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F

> As soon as I dont pass the id like this
>       'url' => array('controller' => 'linkables', 'action' => 'edit')

I presume that having the id hard-coded (66) in the earlier example
was due to you trying to debug this. However, the function itself is
not defined as taking any parameters. So, what does the function
actually look like? And, when you DO pass an id, what does the form
action look like? Have you tried logging $this->params? Or
$this->data?

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

Reply via email to