Re: Clearing handlers added to elements created using wrap method

2010-08-31 Thread George Georgovassilis
Good point... I've been spending too much time writing my own widgets 
lately :-)

Anchor.wrap() takes care of everything.

Gal Dolber wrote:

Are you sure that is required?
That should be automatic


2010/8/31 George Georgovassilis >


RootPanel.detachOnWindowClose(yourWidget)

On Aug 31, 9:06 pm, myapplicationquestions mailto:parag.bhag...@cgi.com>>
wrote:
> Hi All,
>
> I have an existing html and i am adding a simple GWT script to that
> page which will show an alert when an existing link is clicked. I do
> this by the following code
>
> public class ABCMobile implements EntryPoint,ClickHandler
> {
>
>public void onModuleLoad()
>{
>
>   Anchor lo = Anchor.wrap(DOM.getElementById("AMSBrowse"));
>   lo.addClickHandler(this);
>
>}
>
>public void onClick(ClickEvent event)
>{
>   // TODO Auto-generated method stub
>   Window.alert("yeah yeah yeah2");
>
>}
>
> }
>
> Now the question is..
>
> 1) How do i make sure the handler is removed when the page
unloads? I
> could not find anyway to do that.
>
> Let me know if anyone has any suggestions.
>
> Thanks,
> Parag

--
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+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.




--
Guit: Elegant, beautiful, modular and *production ready* gwt 
applications.


http://code.google.com/p/guit/



--
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Clearing handlers added to elements created using wrap method

2010-08-31 Thread Gal Dolber
Are you sure that is required?
That should be automatic


2010/8/31 George Georgovassilis 

> RootPanel.detachOnWindowClose(yourWidget)
>
> On Aug 31, 9:06 pm, myapplicationquestions 
> wrote:
> > Hi All,
> >
> > I have an existing html and i am adding a simple GWT script to that
> > page which will show an alert when an existing link is clicked. I do
> > this by the following code
> >
> > public class ABCMobile implements EntryPoint,ClickHandler
> > {
> >
> >public void onModuleLoad()
> >{
> >
> >   Anchor lo = Anchor.wrap(DOM.getElementById("AMSBrowse"));
> >   lo.addClickHandler(this);
> >
> >}
> >
> >public void onClick(ClickEvent event)
> >{
> >   // TODO Auto-generated method stub
> >   Window.alert("yeah yeah yeah2");
> >
> >}
> >
> > }
> >
> > Now the question is..
> >
> > 1) How do i make sure the handler is removed when the page unloads? I
> > could not find anyway to do that.
> >
> > Let me know if anyone has any suggestions.
> >
> > Thanks,
> > Parag
>
> --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>


-- 
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Clearing handlers added to elements created using wrap method

2010-08-31 Thread George Georgovassilis
RootPanel.detachOnWindowClose(yourWidget)

On Aug 31, 9:06 pm, myapplicationquestions 
wrote:
> Hi All,
>
> I have an existing html and i am adding a simple GWT script to that
> page which will show an alert when an existing link is clicked. I do
> this by the following code
>
> public class ABCMobile implements EntryPoint,ClickHandler
> {
>
>    public void onModuleLoad()
>    {
>
>       Anchor lo = Anchor.wrap(DOM.getElementById("AMSBrowse"));
>       lo.addClickHandler(this);
>
>    }
>
>    public void onClick(ClickEvent event)
>    {
>       // TODO Auto-generated method stub
>       Window.alert("yeah yeah yeah2");
>
>    }
>
> }
>
> Now the question is..
>
> 1) How do i make sure the handler is removed when the page unloads? I
> could not find anyway to do that.
>
> Let me know if anyone has any suggestions.
>
> Thanks,
> Parag

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Clearing handlers added to elements created using wrap method

2010-08-31 Thread myapplicationquestions
Hi All,

I have an existing html and i am adding a simple GWT script to that
page which will show an alert when an existing link is clicked. I do
this by the following code

public class ABCMobile implements EntryPoint,ClickHandler
{

   public void onModuleLoad()
   {


  Anchor lo = Anchor.wrap(DOM.getElementById("AMSBrowse"));
  lo.addClickHandler(this);



   }


   public void onClick(ClickEvent event)
   {
  // TODO Auto-generated method stub
  Window.alert("yeah yeah yeah2");

   }

}


Now the question is..

1) How do i make sure the handler is removed when the page unloads? I
could not find anyway to do that.

Let me know if anyone has any suggestions.

Thanks,
Parag

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.