marcosamz / vaadin-ckeditor

Automatically exported from code.google.com/p/vaadin-ckeditor
0 stars 0 forks source link

CKEditorField BlurEvent notnull validation #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add validation to a CKEditorField field triggered with a BlurEvent. We are 
validating that the field is not empty.
2. Write in the field and lose the focus on it

What is the expected output? What do you see instead?
It is expected that it validates but it doesn't.

What version of the product are you using? On what operating system?
Vaadin 7.1 in Windows.

Please provide any additional information below.
I fixed it by changing the order in which the events are checked. The text must 
be set before checking the blur. In this order:

      // Sets the text
      if (variables.containsKey(VCKEditorTextField.VAR_TEXT) && ! isReadOnly()) {
         // code
      }

      if (variables.containsKey(FieldEvents.BlurEvent.EVENT_ID)) {
         // code
      }

Original issue reported on code.google.com by kdo...@gmail.com on 22 Dec 2014 at 2:52

GoogleCodeExporter commented 9 years ago
Thanks. We'll take a look and see what your code fix implies.  It sounds 
reasonable and thank you for the debugging and code suggestion!

Original comment by yoz...@gmail.com on 22 Dec 2014 at 8:39

GoogleCodeExporter commented 9 years ago

Original comment by yoz...@gmail.com on 16 Jan 2015 at 4:15

GoogleCodeExporter commented 9 years ago
Fixed in release 7.9.5. We waited hoping for a new CKEditor version, but it 
never came, so we're just doing this and release now.

Original comment by yoz...@gmail.com on 21 Jan 2015 at 12:02