[xwiki-users] Using Lightbox to create new page/objet
Hello, I'm trying to use the lightbox.js to provide a nice UI for creating new custom pages/objects. Note : it's not the Lightbox application or macro, but the javascript from lightbox.js ... Idea is to provide a page with following use-case : - user clicks on "create" button - a pop-up (new Lightbox(a,b,c)) is opened - content of this Lightbox is a new page in inline edit mode, on newly created object fields - user should be able to save or cancel (something like user registration) What I don't know is what to provide to Lightbox parameters in order to achieve that. For the first url, I've given something like '/xwiki/bin/edit/Space/MyNewPage?editor=inline&template=MyTemplate&sheet=MySheet&xpage=plain'. But in this case, the modal pop-up contains the fields in inline mode, but without the buttons to save/cancel/preview/... Another question is what to provide as saveurl and redirecturl (2 last parameters of Lightbox) ? Thanks for help, Jeremie -- View this message in context: http://xwiki.475771.n2.nabble.com/Using-Lightbox-to-create-new-page-objet-tp... Sent from the XWiki- Users mailing list archive at Nabble.com.
Well, the answer was not so complex. I took inspiration from the user registration code for this. I created a distinct page, MySpace.MyObjectCreation, that is in charge of : - showing the fields in edit mode for the new object to create (/xwiki/bin/view/MySpace/MyObjectCreation) - creating the new page and object and saving it (/xwiki/bin/view/MySpace/MyObjectCreation?save=true). In this case it also produces some XML output, so I can manage errors upon Ajax call return, and update the redirectionUrl accordingly. This way the original page can nicely show what happened, and display the new object. The result is quite cool, and will be (one day ...) see-able in the Mail Archive application I'm working on :) -- View this message in context: http://xwiki.475771.n2.nabble.com/Using-Lightbox-to-create-new-page-objet-tp... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Jerem, On Mar 16, 2012, at 12:37 PM, jerem wrote:
Well, the answer was not so complex. I took inspiration from the user registration code for this.
I created a distinct page, MySpace.MyObjectCreation, that is in charge of : - showing the fields in edit mode for the new object to create (/xwiki/bin/view/MySpace/MyObjectCreation) - creating the new page and object and saving it (/xwiki/bin/view/MySpace/MyObjectCreation?save=true). In this case it also produces some XML output, so I can manage errors upon Ajax call return, and update the redirectionUrl accordingly. This way the original page can nicely show what happened, and display the new object.
The result is quite cool, and will be (one day ...) see-able in the Mail Archive application I'm working on :)
I'm getting more and more eager about this one :) WDYT about creating a project on xwiki-contrib for example where you could do your commit? This would allow us to see what's going on, i.e. slowly learn what you're doing and possibly help you on some stuff. If one day we wish to make this feature part of the platform it would be a prerequisite that xwiki committers know the code. If you're interested I can create a contrib git repository for you in just a few minutes! Thanks! -Vincent
Hello Vincent, Do you talk about the "modal template" or about the Mail Archive ? ;) BR, Jeremie -- View this message in context: http://xwiki.475771.n2.nabble.com/Using-Lightbox-to-create-new-page-objet-tp... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hello Vincent, For the git contrib for my commits I'm ok, I'll add in progress things to this location. For now I've just started a "xwiki-mailarchive-component", and I'll extract also another component for mail parsing / page creation from mail, but don't know the name for now (it's still embedded in xwiki-mailarchive-component). How do you store the wiki pages in git ? Is there something that could help for that ? I saw that you seem to archive the pages in the format found in .xar ... J. -- View this message in context: http://xwiki.475771.n2.nabble.com/Using-Lightbox-to-create-new-page-objet-tp... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
jerem -
Vincent Massol