aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes popup alert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "popup alert" Watch "popup alert" New topic
Author

popup alert

Ratan Pawar
Ranch Hand

Joined: Jan 18, 2008
Posts: 33
Hello Friends,

i wrote a application for online shopping using servel,jsp and MySQL.
Having two users as shopkeeper and customer.
customer can give a order.And shopkeeper sees the all orders.
Now i want like this whenever a customer gives a order,shopkeeper can see this order in popup alert as "you got a New Order"

How can i do this?

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
You could have a JavaScript running in background firing an Ajax Request every now and then to a servlet that checks for new messages, and returns those if there are any.
Your JavaScript callback method then checks if there are new messages within the response and renders a popup if there are.


JDBCSupport - An easy to use, light-weight JDBC framework -
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Not a JSP question. Moved to the JavaScript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Do you think that the shopkeeper is always going to keep your page open in a browser?
Ratan Pawar
Ranch Hand

Joined: Jan 18, 2008
Posts: 33
Not always.But whenever shopkeeper is doing related task and then if he gets a Order then i want to show a popup alerts.
I tried the ajax at background but if i moved from order page to another shopkeeper related page its not working.
Right now if he goes to order page , he can see all the orders with updated new orders.
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

I tried the ajax at background but if i moved from order page to another shopkeeper related page its not working.


Did you have the same javascript functions on all the pages that the shopkeeper can use?

Also maybe if they are not always going to have the window, it might be worthwhile sending the shopkeeper an email notification as well... just incase they don't have any shop related jobs to do that day

Think about how often you are checking too.
I could see this getting very annoying if you have a big list of orders and every minute you get an alert telling you that there are still more orders waiting!

Sean


I love this place!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: popup alert