Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I close a JSF page from the Java Bean

843842Jan 26 2006 — edited Aug 27 2008
Hi,

I have a JSF window (dialog).
When the user presses the OK button I want to submit an action in the java bean. After that I want to close the window.

What I do today is:
<h:commandButton id="submit" action="#{VersionControlBean.add}" value="#{msgs.ok}"/>
I guess there are 2 options:
1. To close the window (window.close()) from the jsf page itself after the submit, but I don't know how.
2. To do it from the add method in the java bean, but I also don't know how to do it...
(from a servlet I could have done something like:
throw new ServletException("<SCRIPT>window.close()</SCRIPT>");
But how can I do it from the java bean?)

Can anyone help me?
Thanks,
Efrat
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2008
Added on Jan 26 2006
19 comments
7,380 views