12 February 2010

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

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:

Demetrio Filocamo


JBoss RichFaces 3.3 (book) -

Learn RichFaces step by step developing a sample application.

Labels: , , , , ,


Post a Comment

Subscribe to Post Comments [Atom]

<< Home