Do you suggest that extending Widget woul allow to mix HTML and <g:*>
tags in the ui.xml file as I did first ? If I understand well what
happens in the Deferred binding any <g:*> is converted to gwt API
calls to assmble widgets and pannel together, and static HTML have to
be placed into <g:HTML> elements, isn't it ?

Anyway it would be cool to be able to mix pure HTML and <g:*>
component, something similar to Apache Wicket inside GWT :)

I fixed my widget using this layout :

  <g:HTMLPanel tag="li" styleName="{style.event}">
    <g:HTML>
       ... static HTML code ...
    </g:HTML>
    <g:Button ui:field="subscribe"
styleName="{style.button}">Inscription</g:Button>
  </g:HTMLPanel>

With @UiField Button subscribe;
the  @UiHandler( "subscribe" )  public void handleClick( ClickEvent
e ) doesn't work anyway. Just not getting into code when the button is
clicked. Have to investigate more on that.

I tried to extend Widget as you suggested but makes no change.

Nicolas



On 20 déc, 21:34, Ray Ryan <[email protected]> wrote:
> EventWidget must extend Widget, and it will have to be placed in a panel
> whose ultimate ancestor is either a RootPanel or a RootLayoutPanel
>
> On Mon, Dec 21, 2009 at 5:24 AM, nicolas de loof
> <[email protected]>wrote:
>
>
>
> > Hi
>
> > I've migrated some nice HTML/CSS code to uibinder, and would like now to
> > listen to clickEvents on the <button> present in this HTML fragment.
>
> > according to
> >http://code.google.com/intl/fr-FR/webtoolkit/doc/latest/DevGuideUiBin...,
> > I need to use a gwt:Button as replacement for the html element to support
> > GWT event handlers. I tried to use it as is, to wrap all my bloc inside
> > <gwt:HTML> and other ideas, but allways fail with some deferedBinding errors
>
> > Any suggestion ?
>
> > Here is my widget ui.xml :
>
> > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
> >              xmlns:g="urn:import:com.google.gwt.user.client.ui" >
> >   <ui:style>
> > ...
> >   </ui:style>
>
> >     <li class="{style.event}">
> > ... (some nice HTML code)
> >       <button ui:field="subscribe"
> > class="{style.button}">Inscription</button>
> >     </li>
>
> > </ui:UiBinder>
>
> > and java :
>
> > public class EventWidget
> >     extends UIObject
> > {
> >     interface MyUiBinder
> >         extends UiBinder<LIElement, EventWidget>
> >     {
> >     }
>
> >     @UiField
> > //    ButtonElement subscribe;
> >     Button subscribe;
>
> >     @UiHandler( "subscribe" )
> >     public void handleClick( ClickEvent e )
> >     {
> > ...
>
> > --
> >http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to