On Wed, Jul 30, 2008 at 12:42 PM, Marius Dumitru Florea <[email protected]> wrote:
Hi JV,
I don't think I can do that because the WYSIWYG and the submit buttons on the page are separated. For me the WYSIWYG is like an HTML text area. It can be added to a form which contains other fields and possible other WYSIWYG instances. So I think it's good to have the submit buttons separated from the WYSIWYG.
Right, I've replied too fast :)
The only hook is the onsubmit event of the form, provided the WYSIWYG is inside a form, which is not always the case. So I guess I could listen to the submit event, stop it, request the conversion and trigger the real submit after I get the response (following the pattern suggested by you). But as I said, this looks to me like an error-prone code for two reasons:
* the form could already have onsubmit logic/listeners * GWT doesn't provide an API for wrapping an exiting HTML form but only for creating a new one. I'd have to write this code.
So you think this is better than using a filter on the server side?
No, indeed. +1 with : B) Use a servlet filter. JV.