Hey Kalle, See the latest commit. It resolves this issues properly. On each ajax zone update a new ckeditor instance is created and the old ones are properly destoyed using ckeditorinstance.destroy(). Also the attached event handlers on FORM_PREPARE_FOR_SUBMIT_EVENT are removed.
There was a simpler solution destroying the current ckeditor in the FORM_PREPARE_FOR_SUBMIT_EVENT event handler but this caused blinking effect so it was visually not appealing. Share your thoughts if you get to use it, also if you notice further problems please report them. I'll be prob writing some integration tests soon, its on the issues list. Also if you have some ideas what would be the easiest way for this small project to be published on maven central please share. Cheers, Dragan Sahpaski On Fri, Feb 17, 2012 at 10:32 PM, Kalle Korhonen <kalle.o.korho...@gmail.com > wrote: > On Fri, Feb 17, 2012 at 12:33 PM, Dragan Sahpaski > <dragan.sahpa...@gmail.com> wrote: > > OK I see it. After merging the pull request the changes are not saved at > > all. Previously the field gets updated although an errors in the > javascript > > console are thrown upon zone update. > > After merging mine you mean? Yes, that may be the case, but in > principle that's correct way of updating the field and it just makes > the underlying problem visible. Before, "the interesting effects" I > mentioned meant that the field might have been updated with the > contents of the previous zone update, or it might not update all, > depending on which editor instance the user got. The bottom line is > that if there are multiple editor instances associated with the same > element, it's going to blow up sooner or later. > > > I'm on it and will get back to you tomorrow, hopefully with a solution. > > No problem - perhaps you can just check if an editor instance exists > already. For my use case, it's enough that I get the contents via xhr > post, I don't need the editor field to be in the zone. > > Kalle > > > > On Fri, Feb 17, 2012 at 5:02 PM, Kalle Korhonen > > <kalle.o.korho...@gmail.com>wrote: > > > >> On Fri, Feb 17, 2012 at 4:42 AM, Dragan Sahpaski > >> <dragan.sahpa...@gmail.com> wrote: > >> > I'm not quite following you. I've successfully tested it with multiple > >> > editors in one zone with form and it's ok. > >> > Can you send me an example page which has this problem? I promise to > look > >> > at it right away. > >> > >> Odd then, I get multiple editors (and I mean multiple internal > >> CKeditor instances, not visible editors) if I just do: > >> <t:zone t:id="textAreaZone"> > >> <t:form id="textAreaForm" t:zone="textAreaZone"> > >> <t:errors/> > >> <t:textArea id="textArea" t:mixins="pn/CKEditor" > >> value="textValue" > >> parameters="{'toolbar': 'Basic'}" /> > >> <input type="submit" value="OK"/> > >> </t:form> > >> <p><t:outputRaw value="textValue"/></p> > >> </t:zone> > >> > >> Now if I just zone in the outputRaw, things work as expected. I'm > >> returning a zone.getBody from onSuccess(). I really didn't have any > >> existing code, I was just trying out different editor components on an > >> empty archetype. > >> > >> Kalle > >> > >> > >> > >> > On Fri, Feb 17, 2012 at 9:05 AM, Kalle Korhonen > >> > <kalle.o.korho...@gmail.com>wrote: > >> > > >> >> Ah well, partly a user error. If you have the component (mixin) > >> >> wrapped in a zone, you'll get multiple instances of CKEditor with > >> >> plenty of interesting effects. It does make sense not to > re-initialize > >> >> it during ajax updates but wasn't ready to spend enough time to find > >> >> the appropriate place to add safeguards to prevent multiple instances > >> >> within the same zone. Sent a pull request anyway for a minor clean-up > >> >> while I was working on it. > >> >> > >> >> Kalle > >> >> > >> >> > >> >> On Thu, Feb 16, 2012 at 4:52 PM, Kalle Korhonen > >> >> <kalle.o.korho...@gmail.com> wrote: > >> >> > Hey Dusko, Dragan, can tapestry5-ckeditor be configured to work > with > >> >> > ajax forms? I was hoping to use your component as part of a new > >> >> > project. I had hacked chenillekit's fckeditor a few years go to > work > >> >> > with ajax and I imagine this might need similar type of treatment > if > >> >> > it's not already supported. > >> >> > > >> >> > Kalle > >> >> > > >> >> > > >> >> > On Fri, Nov 11, 2011 at 10:16 AM, Dusko Jovanovski < > dusk...@gmail.com > >> > > >> >> wrote: > >> >> >> You can try out our implementation: > >> >> >> https://github.com/plannowtech/tapestry5-ckeditor > >> >> >> > >> >> >> It's still not thoroughly tested, but should work fine. > >> >> >> > >> >> >> Any remarks/complaints/bugs should be reported on GitHub. > >> >> >> > >> >> >> -- > >> >> >> Dusko Jovanovski > >> >> >> > >> >> >> On Fri, Nov 11, 2011 at 4:50 AM, TG <tapestry...@hotmail.com> > wrote: > >> >> >> > >> >> >>> Do we have one? If so, any link to setup and download it? I don't > >> use > >> >> Maven > >> >> >>> just FYI. > >> >> >>> > >> >> >>> Thanks. > >> >> >>> > >> >> >>> -- > >> >> >>> View this message in context: > >> >> >>> > >> >> > >> > http://tapestry.1045711.n5.nabble.com/fckeditor-for-Tapestry-5-3-tp4983201p4983201.html > >> >> >>> Sent from the Tapestry - User mailing list archive at Nabble.com. > >> >> >>> > >> >> >>> > >> --------------------------------------------------------------------- > >> >> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> >> >>> For additional commands, e-mail: users-h...@tapestry.apache.org > >> >> >>> > >> >> >>> > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> >> For additional commands, e-mail: users-h...@tapestry.apache.org > >> >> > >> >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >> For additional commands, e-mail: users-h...@tapestry.apache.org > >> > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >