You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by newtonik <ne...@gmail.com> on 2009/09/01 16:43:45 UTC

FCKEditor Ajax Form Submit

Hey, 
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.


Newton
-- 
View this message in context: http://www.nabble.com/FCKEditor-Ajax-Form-Submit-tp25241614p25241614.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: FCKEditor Ajax Form Submit

Posted by Sebastian Hennebrueder <us...@laliluna.de>.
newtonik schrieb:
> Hey, 
> 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.
> 
> 
> Newton

There is event provided by fckeditor to ensure that the editor value is 
synchronized with the input field.

Here is a jquery snippet
$j("form.evaluateForm").bind('form-pre-serialize', function() {
		var e = FCKeditorAPI.GetInstance('comment') ;
		e.UpdateLinkedField();
	});


-- 
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de



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


Re: FCKEditor Ajax Form Submit

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 09 Jul 2010 20:13:46 -0300, raulmt <ra...@gmail.com> wrote:

> 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.

Hi!

You're absolutely right. Thanks for the tip! :)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: FCKEditor Ajax Form Submit

Posted by raulmt <ra...@gmail.com>.
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 <ne...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: FCKEditor Ajax Form Submit

Posted by newtonik <ne...@gmail.com>.
Thanks Guys, 
Works very well!

Newton

Thiago H. de Paula Figueiredo wrote:
> 
> Em Tue, 01 Sep 2009 11:43:45 -0300, newtonik <ne...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FCKEditor-Ajax-Form-Submit-tp25241614p25242223.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: FCKEditor Ajax Form Submit

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Tue, 01 Sep 2009 11:43:45 -0300, newtonik <ne...@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org