Link is the model in this scenario.

In admin_index,

there is a list of Link records.

This whole list is wrapped within a Form. (Let us call this the
EditListForm)

This EditListForm will post to the admin_edit action of the
controller.

I also have a Add Link Form directly below the list.

The Add Link Form will create a new Link via Ajax. The Ajax response
will return the newly created Link in HTML format. The HTML format
will be treated as a string inside json.

Upon the successful completion, a js function afterAddLink() will be
called to handle the ajax response.

This afterAddLink() js will append the ajax response into the list.
using jquery. I used $('endoflist').before($response);

here comes the issue.

if i add a new link, the new link is displayed at the end of the list.
and if i press the submit button of the EditListForm at this point in
time, the new row will not be posted over.

How do i fix this?

Here are some extra information:
1) i use Security component, but that is not the issue, because when i
use firebug, i cannot see the new row data when i post the
EditListForm.

2) when the new row is added, i did use a Link.id.name, Link.id.id,
etc format for the various input.

3) strangely if I do submit the EditListForm without first adding any
new links, everything will be posted properly.

4) so if i originally have 3 links and I create a new link and then i
submit the EditListForm, the firebug only displays the original 3
links data.

however, if i originally have 3 links and I create a new link and then
I refresh the page. Now i submit the EditListForm, all 4 links will
then be posted.



I cannot post my code because it is over 3 different ctp files in
elements folder and others. so it is a tad messy for me to do so here.

Please advise.

Thank you.

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