I'd like close a dialog after one big process in my back bean. I tried some many things and now I am tried. I want leave a message to the user that the process is keeping going and,of course, show a progressbar n process and close it after take some minutes...simple. Normal approach... but doesn't work. I leave my code to explain better ...
public void sendPush() {
//validacitions...
requestContext.execute("PF('dlg1').show()");//work well...we can see the dialog with the process
myProcess();
}
public void myProcess() {
//simulation only...here will be like 1 minute
Thread one = new Thread() {
public void run() {
try {
Thread.sleep(4000);
} catch(InterruptedException v) {
System.out.println(v);
}
requestContext.execute("PF('dlg1').hide()");//here is the problem...don't close the dialog but when I debug the process pass here
System.out.println("pass here");
}
};
one.start();
}