Search code examples
windowgxt

GXT: Rest data on Window close event


I have a window I've created using UiBinder. I'm followings Sencha's HelloWorldUiBinder example and have placed a form inside the window. I wanted to know how to reset the form data after the widow has bee closed(hiden)?


Solution

  • I figured it out. All I did was add all of my fields to a List, then looped through that list in my closeWindow handler. Calling the rest() method. That clears all the data from my fields. I just need to figure out how to get my Radio buttons to select the default options when the window is reopened.

    The code looks like this:

    @UiHandler("closeButton")
    public void onCloseButtonClicked(SelectEvent event){
           for(Field<?> f : fields){
               f.rest();
           }
           window.hide();
    }