On Monday, June 16, 2014 1:25:23 PM UTC+2, Zied Hamdi OneView wrote:
Hi All,I'm trying to use a UiBinder like this<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent ">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" >
<ui:with field='logo' type='java.lang.String' />
<ui:with field='name' type='java.lang.String' />
<ui:with field='desc' type='com.google.gwt.safehtml.shared.SafeHtml' />
<ui:with field='prodCnt' type='java.lang.String' />
<div class="shopMainCell">
<div class="shopLogo">
<img src='{logo}' />
</div>
<div class="shopProps">
<div class="name">
<ui:text from='{name}'></ui:text>
</div>
<div class="desc">
<ui:text from='{desc}'></ui:text>
</div>
<div class="prodCnt">
<ui:text from='{prodCnt}'></ui:text>
</div>
</div>
</div>
</ui:UiBinder>But I receive two errors:
- java.lang.String required, but {desc} returns com.google.gwt.safehtml.
shared.SafeHtml: <ui:text from='{desc}'> And I know there is no <ui:safeHtml> possible tag
Actually, yes, there is; it's all lowercase though: <ui:safehtml from="{desc}" />
http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html#Hello_Html_Resources
- Escaping unsafe runtime String expression used for URI with UriUtils.fromString(). Use SafeUri instead: <img src='{logo}'> (:9)
What? weren't it complaining it doesn't support a SafeHtml?
No, it was saying that <ui:text from=""/> expects a String (just like it would for a toto="" attribute corresponding to a setToto(String) setter);
but <img src=""/> is known to be a URI reference so it warns when it's not a SafeUri (similarly it would warn for style="{s}" if s is not a SafeStyles)
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment