You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniele Dellafiore <il...@gmail.com> on 2009/07/22 13:08:56 UTC

TinyMCE, in place edit with "on focus lost" and start RTE after a javascript request

Hi everyone, I am trying to get this behavior mixing TinyMCE
wickestuff component and some wicket default ajax features.

I want to press a button, say ADD, that makes a new section appears.
After ADD is pressed, there is a new item in a ListView that contains
a Form that has some TextField and some TextArea with TinyMCEBehavior.
Note: before pressing ADD the first time, there are no form in the
page, and not TextArea and not TinyMCE.

First problem: the RTE appears only after a reload of the page. I
fixed this problem temporary just loading a RTE at the beginning, then
the RTE that appears after the ADD has started working. So, the issue
here is that the Ajax update does not trigger enough thing...

Now, I want to make this RTE a editor in place, I tryed two ways:

1) copy the AjaxEditableLabel code and adapt to a RTE.
Works, and also works with the "ADD feature", always given that a
working RTE is loaded when page is loaded. Same problem as before, but
I have the new features
Problem here is that the AjaxEditableLAbel uses a Label to render
text, and Label does not render HTML properly. There is a wicket
component that renders HTML?

2) use the InPlaceEditComponent procvided with TinyMCE.
This solve the problem of the rendering that I have with soluzion one,
but does not have a feature that I love with AjaxEditablLabel: when
the focus is lost, the AEL switch to the label while with InPlaceEdit
I have to press save. Again, I do not need an advanced them for my
RTE, so I do not want the save.

I would like to go with the InPlaceEdit but it give me more problem:
it does not work when I load it after page is loaded, even if another
one has been alreadty rendered.
And I do not understand why there is not a constructor without a model
so that it uses the model of the form like all other component...

Ideally I would like to go with the InPlaceEdit but seen all the
problems I have, the easiest solution is to find a Component that
renders HTML, with this one I have all that I wanted, and go with my
custom implementation.

So what I need is:
1. a component that renders html
2. a solution to make TinyMCE behavior works if rendered after the
page is loaded the first time *without* having another one already
loaded.

Thanks everyone has even read the whole mail :)

-- 
Daniele Dellafiore
http://blog.ildella.net
http://twitter.com/ildella

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org