• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

popup alert

 
Ratan Pawar
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a JSP question. Moved to the JavaScript forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you think that the shopkeeper is always going to keep your page open in a browser?
 
Ratan Pawar
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic