Rendering TinyMCE editors is easy. Removing editors is a pain! Removing
editors using the tinyMCE.remove function doesn't seem to work that well. To
remove all editors I wrote this Javascript function:
trUnrenderTinyMCE = function(){
// First try to do a nice remove
while ( tinyMCE.remove( tinyMCE.activeEditor ) ) { /* Remove all active
editors */ };
// Then do a brutal remove
var spans = document.getElementsByTagName("span");
for (var i = spans.length - 1; i >= 0; i--){
if (spans[i].className.indexOf("mceEditor") >= 0) {
spans[i].parentNode.removeChild(spans[i]);
}
}
}
Jasper de Vries wrote:
>
> This might help to render an editor when needed:
>
> http://matthiaswessendorf.wordpress.com/2008/02/16/using-dojo-and-apache-trinidad/
>
> You can put the following code in your Java event handler method:
>
> ExtendedRenderKitService service =
> Service.getRenderKitService(
> FacesContext.getCurrentInstance()
> , ExtendedRenderKitService.class
> )
> ;
> service.addScript(
> FacesContext.getCurrentInstance()
> , "alert('Render editor function here');"
> );
>
> See also:
>
> http://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfaces/trinidad/render/ExtendedRenderKitService.html
>
--
View this message in context:
http://www.nabble.com/-Trinidad--about-using-Tinymce-with-Trinidad-tp16202920p20834516.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.