[Product-Developers] prepOverlay destination

Steve McMahon steve at dcn.org
Fri Feb 8 17:27:09 UTC 2013


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 <serge.renfer at gmail.com>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
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20130208/37c9dfd3/attachment.html>


More information about the Product-Developers mailing list