The specification: formselector: 'form.kssattr-formname-@@edit'
has to be a jQuery selector that will uniquely identify the form in the overlay. If it isn't , the overlay ajax form handler won't take responsibility for the form submit process, and the form will submit to another page. On Fri, Feb 8, 2013 at 10:24 AM, Serge Renfer <[email protected]>wrote: > Thank you for your answer Steve. > > But I'm not sure to understand! > > Here is my js : > // edit dialog > $('a.editAuteur').prepOverlay( > { > subtype: 'ajax', > filter: common_content_filter, > cssclass: 'overlay-editAuteur', > formselector: 'form.kssattr-formname-@@edit', > noform: function(el) {return $.plonepopups.noformerrorshow(el, > 'redirect');}, > redirect: $.plonepopups.redirectbasehref, > closeselector: '[name="form.button.Cancel"]', > width:'50%' > } > ); > > And the form (generated by z3.form used by Dexterity) gives the following > source, from the non-overlay edit page (extract around the head of the > form): > > <form class="rowlike enableUnloadProtection kssattr-formname-@@edit" > action=" > http://dev.ageliaco.org:9002/rd/projets-rd/didactique-de-lexpression-francaise/2010/catherine.polli/@@edit" > method="post" id="form" enctype="multipart/form-data"> > Is the "formselector" incorrect in my case? > > If you have any pointer for me to understand my mistakes, I would > appreciate! > > Thanks again! > serge > > > > > 2013/2/8 Steve McMahon <[email protected]> > >> You should suspect that your form selector isn't identifying the form. If >> it doesn't, the form submission is a post rather than an ajax post. So, you >> end up at the action page. >> >> >> On Thu, Feb 7, 2013 at 10:46 PM, Serge Renfer <[email protected]>wrote: >> >>> Hi there, >>> >>> I have the following problem : >>> >>> >>> - I want to expose a list of objects (projects) and on each item I >>> expose a link to edit subobjects (authors, here) >>> - when I click on the edit link I present an overlay with the edit >>> form >>> - when the change is validated I would like to return to the the list >>> >>> But the I have it, it returns from the overlay to the view of the edited >>> subobject. >>> >>> How can I return from this prepOverlay to where I come from (just like >>> when you login in from a document, once you're logged you are returned to >>> this document) >>> >>> Here is my js code : >>> >>> // edit dialog >>> $('a.editAuteur').prepOverlay( >>> { >>> subtype: 'ajax', >>> filter: common_content_filter, >>> cssclass: 'overlay-editAuteur', >>> formselector: 'form.kssattr-formname-@@edit', >>> noform: function(el) {return >>> $.plonepopups.noformerrorshow(el, 'redirect');}, >>> redirect: $.plonepopups.redirectbasehref, >>> closeselector: '[name="form.button.Cancel"]', >>> width:'50%' >>> } >>> ); >>> // Delete dialog >>> $('a.delAuteur').prepOverlay( >>> { >>> subtype: 'ajax', >>> filter: common_content_filter, >>> cssclass: 'overlay-delAuteur', >>> formselector: '#delete_confirmation', >>> noform: function(el) {return >>> $.plonepopups.noformerrorshow(el, 'redirect');}, >>> redirect: $.plonepopups.redirectbasehref, >>> closeselector: '[name="form.button.Cancel"]', >>> width:'50%' >>> } >>> ); >>> >>> and my template code : >>> >>> <td class="noprint" >>> tal:condition="view/canModifyContent"><div > >>> <ul class="the-icons"> >>> <li><a title="Editer cet auteur" class='editAuteur' >>> tal:attributes="href python:author.getURL() + '/edit'" >>> href="#"><i class="icon-pencil"></i> >>> </a></li> >>> <li><a title="Supprimer cet auteur" >>> class='delAuteur' >>> tal:attributes="href python:author.getURL() + >>> '/delete_confirmation'" href="#"><i class="icon-remove"></i> >>> </a></li></ul></div> >>> </td> >>> >>> As you can see, I expose also the possibility to delete the subobject >>> (author), but there too, I go back to the object of the list (the project) >>> and not to the list where I come from! >>> >>> Thanks in advance! >>> serge >>> >>> _______________________________________________ >>> Product-Developers mailing list >>> [email protected] >>> https://lists.plone.org/mailman/listinfo/plone-product-developers >>> >>> >> >> _______________________________________________ >> Product-Developers mailing list >> [email protected] >> https://lists.plone.org/mailman/listinfo/plone-product-developers >> >> >
_______________________________________________ Product-Developers mailing list [email protected] https://lists.plone.org/mailman/listinfo/plone-product-developers
