This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Can a JOptionPane.showMessageDialog be used within  JSF? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Can a JOptionPane.showMessageDialog be used within  JSF?" Watch "Can a JOptionPane.showMessageDialog be used within  JSF?" New topic
Author

Can a JOptionPane.showMessageDialog be used within JSF?

Enrique Villamizar
Ranch Hand

Joined: Jul 30, 2005
Posts: 93
Hi everybody:

In my backing beans I'm trying to use some swing for popup messages...something like this:



The problem is sometimes that messages appear behind the browser window where the user doesn't see them. Usually they appear in font of the browser.

Since it's my first time using JSF (better to say first time using Java on the server side) I was wondering what is the correct way of using these kind of popup messages...or maybe if it's possible to use them in a server application? What is the choice instead of swing?... To be honest I've never seen swing in a server side application (Except applets)?

What would you recommend to a newbie?

Thanks a lot for your help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Backing beans live on the server and only accessible directly via code on the server. To display on the client, your Swing code would have to be on the client (an Applet).

So the short answer is No. Swing cannot be used in JSF or any other J2EE server system (servlets, JSP, Struts, Wicket, etc..

Popup dialogs in JSF are managed via client-side JavaScript. Often in conjunction with AJAX.


Customer surveys are for companies who didn't pay proper attention to begin with.
Enrique Villamizar
Ranch Hand

Joined: Jul 30, 2005
Posts: 93
Thank you very much Tim for your kind reply.

It's good to know it for rerouting the march. It's time of javascript.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can a JOptionPane.showMessageDialog be used within JSF?
 
Similar Threads
Dissecting JSF component and lifecycle phases
Struts JSF Design Flaw (who is to blame)
First Execution of JSF taking more time
Workaround for browser refresh/back button clicks?
Why this client side javascript is not enabled?