Saturday, June 26, 2010

Re: uiBinder and clickevent

Tested with proper class name, works fine:

RootPanel.get().add(new ProductList());

On Sun, Jun 27, 2010 at 3:02 AM, janjan <marjan.f.r@gmail.com> wrote:
Hello all,

I'm trying to use uiBinder. I followed the tutorial provided by
google, but I don't know why clickevent doesn't work? Can anyone help
me? It's couple of hours I'm working on it but can't find the problem!

Thanks you so much

P.S.
I'm using NetBeans 6.9, gwt 2.0.3
------------------------------------------------------------------------------------------
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
       xmlns:g="urn:import:com.google.gwt.user.client.ui">
       <ui:style>
       </ui:style>
       <g:HTMLPanel>
        <table>
            <tr>
                <td><img ui:field='imgPrd'/></td>
                <td>
                   <span ui:field='lblNum'>0</span>
                    <g:Button ui:field='btnAdd'>Add to basket</
g:Button>
                </td>
            </tr>
        </table>
       </g:HTMLPanel>
</ui:UiBinder>
-------------------------------------------------------------------------------
public class uiProductList extends Composite {

   @UiField Button btnAdd;
   @UiField ImageElement imgPrd;
   @UiField SpanElement lblNum;

   int count;
   private static uiProductListUiBinder uiBinder =
GWT.create(uiProductListUiBinder.class);

   interface uiProductListUiBinder extends UiBinder<Widget,
uiProductList> {
   }

   public uiProductList() {
       initWidget(uiBinder.createAndBindUi(this));
   }


  @UiHandler("btnAdd")
   void handleClick(ClickEvent e) {
      Window.alert("test");
 }

}

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


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

No comments:

Post a Comment