Re: [g:Label] [special character] Why it works in ui:binder but not with setText() ?

39 views
Skip to first unread message

Thomas Broyer

unread,
Dec 11, 2012, 9:29:02 AM12/11/12
to google-we...@googlegroups.com
✖ in your ui.xml is interpreted by the XML parser used at compile-time to generate the corresponding Java code. The generator will then generate something like `close.setText("\u2716")` (actually, because it generates files in UTF-8, it probably just uses `close.setText("✖")`).
An alternative would be to use an HTML widget and close.setHTML("✖")

On Tuesday, December 11, 2012 1:58:49 PM UTC+1, regnoult axel wrote:
Hello,

My 'close' label needs a special character so I do : close.setText("✖"); but then it appears ✖

Instead of calling setText(), in uiBinder I could have a working solution: 

<g:Label
     ui:field="close"
     addStyleNames="{C.C_CSS.cross}">&#10006;</g:Label>


My question is : Why setText() does not give me the special character (a cross) appearing ?
What should be the easier solution in my case (I cannot use uibinder) ?

Thanks you,
Reply all
Reply to author
Forward
Message has been deleted
0 new messages