well you need to know when to use the DOM and when to use the RootPanel,
usually RootPanel works only on DIV tags while the DOM can traverse any kind
of html tags. so in your case you can add a button with a click dynamically
by using DOM. but i dont use this, try to use DIVs as much as you can.
The example you provided would work with
RootPanel.get("sendButtonContainer").add(button);
if the id "sendButtonContainer" was for a div and not a tdOn Tue, Mar 23, 2010 at 5:42 AM, msaif <[email protected]> wrote: > For example I took html from a designer which is given below. > How can i add click event which shows alert from GWT? > > <table align="center"> > <tr> > <td id="nameFieldContainer"><input type="button" name="x" > id="x" value="OK" /></td> > </tr> > </table> > > final Button button = new Button("OK"); > I dont allow to add button dynamically from GWT by > RootPanel.get("sendButtonContainer").add(button); > > I am searching the syntax something like: > RootPanel.get("sendButtonContainer").getWidget(0).addEventListener()??????? > Jquery can search the button object from nameFieldContainer and > dynamically add click event listener but is it possible in GWT?? > > -- > 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]<google-web-toolkit%[email protected]> > . > 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 [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.
