Author: christian.bauer(a)jboss.com
Date: 2008-06-30 09:15:47 -0400 (Mon, 30 Jun 2008)
New Revision: 8429
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/editor/WikiTextEditor.java
Log:
Validate wiki text markup on preview enabled
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/editor/WikiTextEditor.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/editor/WikiTextEditor.java 2008-06-30
02:06:19 UTC (rev 8428)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/wikitext/editor/WikiTextEditor.java 2008-06-30
13:15:47 UTC (rev 8429)
@@ -143,6 +143,11 @@
}
public void setPreviewEnabled(boolean previewEnabled) {
+ if (previewEnabled) {
+ validate();
+ } else {
+ setValid(true);
+ }
this.previewEnabled = previewEnabled;
}
@@ -207,6 +212,7 @@
WikiFormattedTextValidator validator = new WikiFormattedTextValidator();
validator.validate(null, null, value);
}
+ log.debug("value is valid");
setValid(true);
} catch (ValidatorException e) {
log.debug("exception during validation: " +
e.getFacesMessage().getSummary());
Show replies by date