Problem with Progress Indicator

Hi,

The application I’m working on incorporates the ability to upload and parse an excel sheet. Because this can potentially take a long time; I’m showing the user a Progress Indicator as the excel sheet is being parsed. I also show a state of the upload/parse process and the file name of the file being parsed (similar to the upload example in the Vaadin sampler).

All this works fine. The problem is when the parsing process is completed. At that point, I want the Progress Indicator to stop polling since the parse is now complete. I ALSO want to hide the layout that the progress indicator is a part off - the state of the upload and file name now are no longer relevant.

If I hide the progress indicator; it stops polling. However, if I ALSO hide the layout it’s in, it starts polling again.

In other words:


public class ExcelParsingThread extends Thread
{

 public void run()
{

    try
    {
     // logic to parse excel file and update progress indicator

    }
    finally
    {
         progressIndicator.setVisible(false);

    }
}

}

stops the progress indicator from polling when the finally block is reached; but


public class ExcelParsingThread extends Thread
{

 public void run()
{

    try
    {
     // logic to parse excel file and update progress indicator

    }
    finally
    {
         progressIndicator.setVisible(false);

         statusLayout.setVisible(false);

    }
}

}

doesn’t?

Seems like a bug to me - is this the same bug as http://dev.vaadin.com/ticket/1581?

Is it impossible to just set the progress indicator to null and instantiate it again when needed ?

This is
#4014
.

The easiest workaround is probably to remove the progress indicator from the layout containing it when you want it to stop, and re-add it when necessary.

Thanks Henri.