demetrio812

12 February 2010

RichFaces editor: how to intercept the “return” key to submit a form

Hello,
I'll try to write more on my blog and keep you update about every technique I use and that can be very useful to you as well.

Today I needed to submit a form with an editor element when the user pressed the "return" key (instead of creating a new line).

The code is not so complicate but as the rich:editor uses the TinyMCE component you have to search all around to find the right way. Better to have a complete solution.

It consists on creating an handler onKeyPress and call a javascript function (created by a:jsFunction) to submit our form. Simpler doing then saying it.

To read all the article click the following link:

http://blog.demetrio.it/2010/02/12/richfaces-editor-how-to-intercept-the-return-key-to-submit-a-form/

Demetrio Filocamo


------

JBoss RichFaces 3.3 (book) - http://www.packtpub.com/jboss-richfaces-3-3


Learn RichFaces step by step developing a sample application.

Labels: , , , , ,

1 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home