Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a JOptionPane.showMessageDialog be used within JSF?

 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Tim for your kind reply.

It's good to know it for rerouting the march. It's time of javascript.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic