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/DevGuideUiBinder.html#Simple_binding,
> 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