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
- 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?
Finally, besides all this, I have an issue with the interpretation of the HTML code: the HTML code is escaped when passed to the UiBinder renderer (but as you saw at the mail start, the uiBinder doesn't accept safe html). I already had this kind of issues, I know it's related to the GWT security, but it was never clear to me, how to control this aspect (it always was solved by experimenting)
(a sample escaped code: <b> is replaced with <b>)
<div class="desc"> Voilà une entreprise qui innove, les annonces ont souvent été au <b>coeur des relations</b> humaines, depuis l'arrivée des villes puis d'internet, les gens ont adopté de nouveaux reflexes...</div>
A good documentation on all these aspects is naturally welcome, I can't find one, and diving into the code for each issue is time consuming...
Thanks a lot in advance, I posted this here since there are maybe already solutions so there's no need to discuss it in the contributor group
Best Regards,
Zied
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