Thiago, this snippet, at least in T5.1, does not always work. Tapestry also
"listens" the submit event of the form (in fact, it replaces the onsubmit
property of the form). So, if you have bad luck, the submission of the form
will ocurr before FCK can update the linked field.

To ensure that FCK updates the linked field before Tapestry sends the Ajax
Request, you must listen the Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT, which
is fired syncronously before the Ajax Request is generated. So, the code
should look like this:

$('formId').observe(Tapestry.FORM_PREPARE_FOR_SUBMIT_EVENT,
function(){FCKeditorAPI.Instances['fckFieldId'].UpdateLinkedField();});

I know this is an old post, but I lost a couple of hours on getting this to
work (because listening on submit event didn't work in IE on a slow
machine), so I hope this helps somebody…

Regards.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Tue, 01 Sep 2009 11:43:45 -0300, newtonik <newto...@gmail.com>
> escreveu:
> 
>> Hey,
> 
> Hi!
> 
>> Has anyone been able to figure out a way to use the FCKEditor in a ajax  
>> form submission. It seems like the data in the editor doesn't get  
>> assigned during a ajax submit. This prevents me using formzone when I  
>> have fckeditors
>> textarea. Has anyone worked around this issue?  Thanks.
> 
> The solution I've found was to add the following JavaScript snippet:
> 
> Event.observe('form', 'submit', function() {  
> FCKeditorAPI.Instances['editor'].UpdateLinkedField(); });
> 
> Replace editor with your field id.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/FCKEditor-Ajax-Form-Submit-tp25241614p29123136.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

Reply via email to