Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT CellTable Input Validation
    primarykey
    data
    text
    <p>I would like to implement something similar to the Cell Validation showcase example, which can be found here </p> <p><a href="http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCellValidation" rel="nofollow">http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCellValidation</a></p> <p>After looking through the code and trying to implement it, there seems to be a class/variable deffinition missing for template. which shows up in the code in 2 places</p> <pre><code>public ValidatableInputCell(String errorMessage) { super("change"); if (template == null) { template = GWT.create(Template.class); } this.errorMessage = SimpleHtmlSanitizer.sanitizeHtml(errorMessage); } SafeStyles safeColor = SafeStylesUtils.fromTrustedString("color: " + color + ";"); sb.append(template.input(pendingValue != null ? pendingValue : value, safeColor)); if (invalid) { sb.appendHtmlConstant(" &lt;span style='color:red;'&gt;"); sb.append(errorMessage); sb.appendHtmlConstant("&lt;/span&gt;"); } </code></pre> <p>After searching the web i found a few examples of what the template variable definition should be and came up with</p> <pre><code>interface Template extends SafeHtmlTemplates { @Template("&lt;input type=\"text\" value=\"{0}\" tabindex=\"-1\" size=\"{1}\"&gt;&lt;/input&gt;") SafeHtml input(String value, SafeHtml safeStyles); } private Template template; </code></pre> <p>with the above code added in there are no compiler warning howver when the code is executed i get this error</p> <blockquote> <p>SafeStyles used in a non-CSS attribute context. Did you mean to use java.lang.String or SafeHtml instead?</p> </blockquote> <p>Any ideas of how to fix this problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload