| 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: 56150
|
|
|
Not a JSP question. Moved to the JavaScript forum.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
|
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!
|
 |
 |
|
|
subject: popup alert
|
|
|