Wednesday, July 30, 2014

How to make Div and Image flow inline in GWT?

There is following code in UiBinder

<div class="{style.flowInline}">     <div class="{style.flowInline}" ui:field="text1Div" />     <g:Image ui:field="image1" addStyleNames="{res.css.flowInline}" />     <div class="{style.flowInline}" ui:field="text2Div" />     <g:Image ui:field="image2" addStyleNames="{res.css.flowInline}" />  </div>

in Css

.flowInline  {      display:inline-block;  }

This is the requirement. I want the text1, image1, text2, image2, flow in the same line.

text1Div.setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant("Please:<BR/> Click"));  text2Div.setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant("and<BR/> Click"));

It should show the result:

Please:  Click [image1] and  Click [image2]  

But somehow it didn't work

If I don't use Div in UiBinder

<div>     Please: <BR/>     Click <g:Image ui:field="image1" /> and <BR/>     Click <g:Image ui:field="image2" />  </div>

Then it work fine

So, how to fix it?

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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment