Here is kind-a workaraound that worked for me:
in cell widget declarative ui add following:
...
...
=
In the code then:
=
...
interface MyUiRenderer extends UiRenderer {
...
void render(SafeHtmlBuilder sb, ... ,SafeHtml loadingIcon);
...
}
@Override
public void render(Context context, ..., SafeHtmlBuilder sb) {
if (value == null) {
return;
}
ImageResourceRenderer imageRenderer = new ImageResourceRenderer();
renderer.render(sb, ... ,imageRenderer.render(images.checkOk()));
}
=
On Monday, February 8, 2010 1:49:22 AM UTC-8, cpm wrote:
>
> I'm another one finding that the resource="{res.myImage}" just won't
> work.
>
> My findings are that I can have just in
> the file along with an @sprite .logo { gwt-image: "myImage"; } and as
> long as I have an image file called myImage.png in the same package/
> directory it'll work.
> You don't seem to need a resource="" or src="" on the ui:image tag at
> all - the field attribute is the name of the image it'll look for
> unless you add a src attribute. This would explain why emerix was
> getting an "No com.google.gwt.resources.client.ClientBundle $Source
> annotation and no resources found with default extensions " error
> with:
>
>
>
> It's just ignoring the resource attribute and looking for a logo.png
> file instead.
>
> The src attribute seems to work like the @Source annotation you would
> put in a ResourceBundle, such as:
>
> @Source("myLogo.png")
> ImageResource logo();
>
> I would expect this to be the same as:
>
>
>
>
> The same seems to apply then when you try to use field="logo" resource="{res.myLogo}" />
> The resource attribute is ignored and its still looking for a logo.png
> in the current directory and flagging an error that no Source
> annotation has been given.
> What you need to do to get the resource atrribute to work, I've no
> idea, but it would be a neater solution if it did work.
>
> but I got the error :
>
> On Jan 18, 5:12 pm, emerix wrote:
> > Hi,
> >
> > I'm also still looking for some documentation on this tag.
> > (and the other tags also : ui:data, ui:attribute, ...)
> >
> > Do anyone know how to put absolute path in the src attribute ?
> > > ui:image>
> > doesn't work :/
> >
> > Using relative path works but I have to change it every time I copy
> > the code to another widget :/
> >
> > ++emerix
> >
> > On Jan 17, 6:05 pm, Nico wrote:
> >
> > > Thanks emerix for the src="" tips. It helped me a lot.
> >
> > > I have the same problem when I use resource="{res.myImage}" ...
> >
> > > I have declared the targeting the right Resource
> > > class but I always have an error that says : No
> > > com.google.gwt.resources.client.ClientBundle$Source annotation and no
> > > resources found with default extensions
> >
> > > However, I don't know where to find doc about tag. Where
> > > did you find that there was a src or a resource attribute ? directly
> > > in the source code ?
> > > Thanks a lot.
> >
> > > Nicolas
> >
> > > On 12 jan, 17:24, Chris Ramsdale wrote:
> >
> > > > Do you have the following in your ui.xml file:
> >
> > > >
> >
> > > > ...where 'com.google.gwt.sandbox.client.Resources' is replaced with
> your
> > > > resources class.
> >
> > > > On Thu, Jan 7, 2010 at 5:24 AM, emerix wrote:
> > > > > Hello,
> >
> > > > > I tried using relative paths for the resource property :
> > > > > resource='../resources/my_logo.png'>
> >
> > > > > but I got the error : No
> com.google.gwt.resources.client.ClientBundle
> > > > > $Source annotation and no resources found with default extensions
> >
> > > > > if I use the src property, everything is ok :
> > > > >
> >
> > > > > hope someone find this useful :)
> >
> > > > > However what I really wanted is using your 2nd solution :
> > > > >
> > > > > but when I load the page I also get the error : No
> > > > > com.google.gwt.resources.client.ClientBundle$Source annotation and
> no
> > > > > resources found with default extensions
> >
> > > > > am I missing something ?
> >
> > > > > thanks a lot :)
> >
> > > > > ++emerix
> >
> > > > > On Jan 4, 11:15 pm, Chris Ramsdale wrote:
> > > > > > One option would be to use relative paths within the
> element.
> > > > > For
> > > > > > example:
> >
> > > > > > resource='../resources/my_logo.png'>
> >
> > > > > > Another option would be to use , get a hold of the
> ClientBundle,
> > > > > > and reference an image within it.
> >
> > > > > > public interface Resources extends ClientBundle {
> > > > > > @Source("com/google/gwt/sandbox/resources/my_logo.png")
> > > > > > ImageResource logo();
> >
> > > > > > }
> >
> > > > > >
> > > > > > ...
> > > > > >type='com.google.gwt.sandbox.client.Resources'/>
> > > > > >
> > > > > > ...
> > > > > >
> >
> > > > > > Underscores within the filename are completely valid (the above
> examples
> > > > > > compile and run w/o issue).
> >
> > > > > > On T