I'd like to have an image within an anchor or a button tag. I'm using
the UiBinder and I need the anchor or button to be a widget so I can
use their "HasClickHandlers" interface.

I wanted to use an image widget so I can use an ImageResource,
something like this:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
             xmlns:g='urn:import:com.google.gwt.user.client.ui'>

  <ui:with field='res' type='com.test.Test.Resources'/>

  <g:HTMLPanel>
    <g:Anchor><g:Image resource="{res.add}" /> Add</g:Anchor>
  </g:HTMLPanel>

</ui:UiBinder>

But since neither the Anchor nor the Button can take widgets, I get
the "Found widget in an HTML context" error.

I've seen posts mentioning the "ui:image" tag but couldn't find
documentation on how to use it and I couldn't get it to work.

If I do:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
             xmlns:g='urn:import:com.google.gwt.user.client.ui'>

  <g:HTMLPanel>
    <ui:image src="add.gif" />
  </g:HTMLPanel>

</ui:UiBinder>

It's doing something since it won't compile if "add.gif" is not under
the right package. However when I see it in the browser, the ui:image
didn't get compiled into an image.

Do you know what am I missing here?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to