Update textarea (tinyMCE) using Ajax/RJS

Hi -

I have a <select> which I am allowing users to select text bodies which are automatically populating a textarea on the page - which they can then edit.

This is working fine. However... once I add my tinyMCE editor to the textarea it doesn't work - it won't update.

I am using the tinymce plug-in by Blake Watters.

I know tinymce initiates the textarea or filters its values through its initiation, but curious how to execute this when I do my page update via my rjs file.

Any help appreciated.

-Adam

northband wrote:

Hi -

I have a <select> which I am allowing users to select text bodies which are automatically populating a textarea on the page - which they can then edit.

This is working fine. However... once I add my tinyMCE editor to the textarea it doesn't work - it won't update.

I am using the tinymce plug-in by Blake Watters.

I know tinymce initiates the textarea or filters its values through its initiation, but curious how to execute this when I do my page update via my rjs file.

Any help appreciated.

-Adam

try page.call ( 'tinyMCE.setContent', 'your content here') obviously if your content is a ruby variable, drop the quotes This has problems if you have multiple editors on a page. I also noticed that I had some trouble unless I used the html text_area tag instead of the text_area helper, but ymmv.

northband wrote:

Hi -

I have a <select> which I am allowing users to select text bodies which are automatically populating a textarea on the page - which they can then edit.

This is working fine. However... once I add my tinyMCE editor to the textarea it doesn't work - it won't update.

I am using the tinymce plug-in by Blake Watters.

I know tinymce initiates the textarea or filters its values through its initiation, but curious how to execute this when I do my page update via my rjs file.

Any help appreciated.

-Adam

Hi Adam,

I have a smiliar problem how did you update the text area? I have an id associated with text area and on click of a tree element, I intend to update teh content of text area somehow the position:top position:bottom does not work.

Thanks, Sudhi

Here’s an old (2006) of mine that has an example of getting TinyMCE’s javascript to work after some other javascript runs. Might be useful or it might be out of date.

http://blog.katipo.co.nz/?p=24