tags:

views:

18

answers:

1

hello Is there any way to open a popup from a servlet I have an asynchronous process running , and I need to somehow notify the user when finished, without having to refresh the page

any ideas ??

+2  A: 

"Without having to refresh the page"

That's what Ajax is all about I suggest that you take a look to some Ajax enable JSF framework, like Richfaces, if you're using JSF 2.0 you can use Ajax behavior by default.

With Richfaces you can use the <a4j:poll> to check after some period of time if the asynchronous process have finished, you can then re-render the appropriate message.

 <a4j:poll interval="1000" enabled="#{notificationBean.isTaskComplete}"
                reRender="completeMessagePanel" />

Thats the general Idea.

StudiousJoseph
yes, that's right, i'm using icefacesi think i could make a function that constantly ask if the process has finish, like an alert system, I thought that could be done from the servlet
ErVeY
Hi, I dont know much icefaces, but it seems that you can have what they call a "server-initiated rendering" http://www.icefaces.org/docs/v1_8_2/htmlguide/devguide/AdvancedTopics2.html#1075177. Probably you can do the same from your managed bean, once and your process have finished.
StudiousJoseph
i'll try that thx ;D
ErVeY