Ok many thanks Thomas for the help,
Le lundi 16 juin 2014 13:45:33 UTC+1, Thomas Broyer a écrit :
-- So I'll try to put a variable of type SafeUri to <img src={safeUri}"> I thought that since the method accepts a String in src, it would need another attribute for the SafeUri
May I suggest to put it all together in a different documentation than the one for uiBinder (example in UiRenderer): Indeed I've read that page, and since it is somewhere in the resources, I skipped it. I know that in the code it's related (UiBinder, UiRenderer, eventually ClientBundle), but conceptually as a user I perceive those things as separate enough to be in different sections (naturally it's only my point of view as an old GWT user, that saw the things being added gradually. I think, it could be confusing for a newbie to see UiBinder in the same section as UiRenderer)
Anyway, thanks for the help, I'm glad I'm able to keep going :)
Le lundi 16 juin 2014 13:45:33 UTC+1, Thomas Broyer a écrit :
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 tagActually, yes, there is; it's all lowercase though: <ui:safehtml from="{desc}" />
- 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