It worked!
Problem was with the image size. Gave proper image width and height now.

Thanks.

On Tuesday, July 23, 2013 12:27:02 PM UTC+5:30, Akshay Lokur wrote:
>
> Hello,
>
> I am using UiBinder and MVP pattern to develop my GWT application.
>
> Below is my .css file snippet:
>
> @sprite .statementLink span {
>>      gwt-image:'pdfIcon';
>>      display: inline-block;
>>      width: 16px;
>>      Height: 16px;
>>      Margin-right: 5px;
>>  }
>>
>
> The image "pdfIcon.png" is present in classpath at location 
> "/my-project/src/main/resources/com/lokur/client/pdfIcon.png"
>
> Below is my ClientBundle.java snippet:
>
> public interface PreviewBundle extends ClientBundle {
>>     public static final PreviewBundle INSTANCE =  
>> GWT.create(PreviewBundle.class);
>>
>>     @Source("my-style.css")
>>     @NotStrict
>>     public MyCss css();
>>     
>>     @Source("pdfIcon.png")
>>     public ImageResource pdfIcon();
>>     
>>     interface MyCss extends CssResource {
>>          String statementLink();
>>     }
>> }
>>
>  
> and below is how I am using above css in my CellTable's cell in my 
> View.java:
>
> Column<MyCellTable, SafeHtml> statementsColumn = new Column<MyCellTable, 
>> SafeHtml>(new ClickableHtmlCell()) {
>>             @Override
>>             public SafeHtml getValue(MyCellTable stmtsTbl) {
>>                 SafeHtml STATEMENT_LINK = 
>>                         SafeHtmlUtils.fromSafeConstant("<a 
>> href=\"javascript:void(0);\" class=\"" + 
>>                                                                     
>> PreviewBundle.INSTANCE.css().statementLink() + 
>> "\"><span>&nbsp;</span>"+stmtsTbl.getStatement()+"</a>");
>>                 return STATEMENT_LINK;
>>             }
>>         };
>>
>
>
> However the image pdfIcon.png is not getting rendered on screen! 
> Any clue why so?
>
> Many Thanks,
> Akshay
>

-- 
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+unsubscr...@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/groups/opt_out.


Reply via email to