On Wednesday, May 2, 2012 6:14:35 PM UTC+2, Joseph Lust wrote:
>
> @Template("<div style=\"{0}\"><div 
> style=\"position:absolute;display:none;"\></div><div>{1}</div></div>")
> SafeHtml unsorted(SafeStyles imageWidthStyle, SafeHtml text); 
>
> double width = 34.34d;
> SafeStyles imageWidthStyle = 
> SafeStylesUtils.fromTrustedString("width:"+width+"px;");
> SafeHtml text = SafeHtmlUtils.fromString("blah");
> unsorted( imageWidthStyle, text ); // call your template
>
>
> That is how I'd do it. I had to fix some warnings to this end this morning 
> for some code, so I had to look this usage up. Hope it helps.
>

And when GWT 2.5 will be out the door:
SafeStyles imageWidthStyle = SafeStylesUtils.forWidth(width, Unit.PX);

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/8nsX4U_n1P8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to