473,287 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

newbe javascript refresh prob

Hi,

I have a private website for 20 people that is similar to a web email client
like hotmail.
There are two frames, one on the left with links for "New", "History",
"Todays" and a frame on the right with a table for viewing the contents of
these messages. The left pane checks back with the server every few seconds
to see if any new messages need to be processed and updates count
accordingly.

When 10 new messages arrive, the left pane updates for everyone (Example
New(10))
Anyone who clicks on this link will see these messages in the right hand
pane. However each meassage can be confirmed as processed by any of the
users. Problem is that right now if one of these users confirms a message (9
remaining) the other users will still see the original 10.

I need some method of forcing a refresh on this right hand pane for the
other users that are looking at the New page.
Would the following work.... If a user clicks on a link in the left pane, is
there a way to store the page referenced in a variable, so that when the
leftpane checks back with the server it can see if anyone has processed any
messages and refresh the pane accordingly? Someone had suggested an applet
iw the only way to ahcieved the desired soln and I am hoping for a more
simplistic answer.

Thank you,
Steve
Jul 20 '05 #1
5 4425
"Steve" <s@h.com> wrote in
news:dY*******************@news-server.bigpond.net.au:
Hi,

I have a private website for 20 people that is similar to a web email
client like hotmail.
There are two frames, one on the left with links for "New", "History",
"Todays" and a frame on the right with a table for viewing the
contents of these messages. The left pane checks back with the server
every few seconds to see if any new messages need to be processed and
updates count accordingly.

When 10 new messages arrive, the left pane updates for everyone
(Example New(10))
Anyone who clicks on this link will see these messages in the right
hand pane. However each meassage can be confirmed as processed by any
of the users. Problem is that right now if one of these users confirms
a message (9 remaining) the other users will still see the original
10.

I need some method of forcing a refresh on this right hand pane for
the other users that are looking at the New page.
Would the following work.... If a user clicks on a link in the left
pane, is there a way to store the page referenced in a variable, so
that when the leftpane checks back with the server it can see if
anyone has processed any messages and refresh the pane accordingly?
Someone had suggested an applet iw the only way to ahcieved the
desired soln and I am hoping for a more simplistic answer.

refreshing right pane is dangerous because someone might be in the middle
of doing something in the right pane, like selecting a message to be
processed. Also, you will never be able to get the kind of time
resolution you need to make sure users are never trying to process a
message that is already processed.

here are two easy things I think would improve the situation.

1. If a user processes a message that is previously processed, notify
them when they try to process it.

2. In left frame, continue to refresh as per normal, but provide some
obvious visual clue if something has changed since the last refresh and
tell them they need to update the right frame.

so you will need to develop logic to determine last vs. current state -
perhaps the left hand frame is a form you keep re-submitting with its
last known state stored somewhere via javascript timers.
hope I have understood your problem correctly.
--
In theory there is no difference between theory and practice. In practice
there is. - YB
Jul 20 '05 #2
"Steve" <s@h.com> wrote in
news:dY*******************@news-server.bigpond.net.au:

sorry, last paragraph should say

so you will need to develop logic to determine last vs. current state -
perhaps the left hand frame is a form you keep re-submitting via javascript
timers with its last known state stored in a form variable.

--
In theory there is no difference between theory and practice. In practice
there is. - YB
Jul 20 '05 #3
Thanks Sean, you have understood the problem perfectly.
I am too new to Javascript to determine if this is possible. If it is, then
I would like to explain to a programmer I am working with how it could be
accomplished without use of an applet.
"refreshing right pane is dangerous because someone might be in the middle
of doing something in the right pane"
I was a bit worried about this too. I do have some Java Validation in the
back end that will not process messages that have already been confirmed,
but you are correct in declaring that the user would need to be notified of
this.
"In left frame, continue to refresh as per normal, but provide some
obvious visual clue if something has changed since the last refresh and
tell them they need to update the right frame."
There is a visual cue although they may not notice it. The count in the left
pane would go from 10 to 9 (ie New(9)).

So if I address the risks above, do I take it that Javascript could indeed
manage to refresh the right pane for only those users who are looking at the
"New" pane?
Can the left pane hold some sort of flag variable (example flag=frame, where
frame could be new,history etc). then when it checks the server every couple
of seconds if someone has processed a "New" message the right frame can be
refreshed?

Steve
"Sean Jorden" <s_***********@no.spam.n_o_r_a.d.a.com> wrote in message
news:Xn********************@198.161.157.145... "Steve" <s@h.com> wrote in
news:dY*******************@news-server.bigpond.net.au:
Hi,

I have a private website for 20 people that is similar to a web email
client like hotmail.
There are two frames, one on the left with links for "New", "History",
"Todays" and a frame on the right with a table for viewing the
contents of these messages. The left pane checks back with the server
every few seconds to see if any new messages need to be processed and
updates count accordingly.

When 10 new messages arrive, the left pane updates for everyone
(Example New(10))
Anyone who clicks on this link will see these messages in the right
hand pane. However each meassage can be confirmed as processed by any
of the users. Problem is that right now if one of these users confirms
a message (9 remaining) the other users will still see the original
10.

I need some method of forcing a refresh on this right hand pane for
the other users that are looking at the New page.
Would the following work.... If a user clicks on a link in the left
pane, is there a way to store the page referenced in a variable, so
that when the leftpane checks back with the server it can see if
anyone has processed any messages and refresh the pane accordingly?
Someone had suggested an applet iw the only way to ahcieved the
desired soln and I am hoping for a more simplistic answer.

refreshing right pane is dangerous because someone might be in the middle
of doing something in the right pane, like selecting a message to be
processed. Also, you will never be able to get the kind of time
resolution you need to make sure users are never trying to process a
message that is already processed.

here are two easy things I think would improve the situation.

1. If a user processes a message that is previously processed, notify
them when they try to process it.

2. In left frame, continue to refresh as per normal, but provide some
obvious visual clue if something has changed since the last refresh and
tell them they need to update the right frame.

so you will need to develop logic to determine last vs. current state -
perhaps the left hand frame is a form you keep re-submitting with its
last known state stored somewhere via javascript timers.
hope I have understood your problem correctly.
--
In theory there is no difference between theory and practice. In practice
there is. - YB

Jul 20 '05 #4
"Steve" <s@h.com> wrote in
news:E4*******************@news-server.bigpond.net.au:
Thanks Sean, you have understood the problem perfectly.
I am too new to Javascript to determine if this is possible. If it is,
then I would like to explain to a programmer I am working with how it
could be accomplished without use of an applet.
be warned it will not be possible to get *exactly* what you want in a
stateless (ie HTTP) environment. You need applets which are always
connected if you want sub-second notification. There are hacks you can
use by having a script driven HTML page load forever, spewing out
javascript directives based on server messages, but this can get dicey...
I think you can settle for Ebay-like currency of information here.

I was a bit worried about this too. I do have some Java Validation in
the back end that will not process messages that have already been
confirmed, but you are correct in declaring that the user would need
to be notified of this.
you could even go a step further by locking a message once a user has
merely opened it, but this creates at least 2 further issues,
1) a disagreeable user may lock many at once - you may have to program
limits
2) a user may open something and then forget about it, so you may have to
place time limits on the lock.

but that would make things extrememly current - another user knows the
state of a message as soon as they open it.

Of course, I don't know if these messages are completely contained in a
list, or you have to click on a link in a summary list to get a complete
form.

There is a visual cue although they may not notice it. The count in
the left pane would go from 10 to 9 (ie New(9)).

So if I address the risks above, do I take it that Javascript could
indeed manage to refresh the right pane for only those users who are
looking at the "New" pane?
Can the left pane hold some sort of flag variable (example flag=frame,
where frame could be new,history etc). then when it checks the server
every couple of seconds if someone has processed a "New" message the
right frame can be refreshed?


if you stored the last state - ie date/time and count (you need date as
well because a message could arrive and have been processed since last
refresh, so count would be the same) then you could know if things
changed in reality and make it bright red or something.

I would store those variables in hidden form fields and then re-submit to
server every x seconds.

again, I personally wouldn't refresh the right pane with javascript but
instead let the users know that the information they are looking at isn't
current and they need to click on the left pane again. You said there
were a few other links in the left side, right? They might not even be in
the 'new messages' page.
Jul 20 '05 #5
> You said there
were a few other links in the left side, right? They might not even be in
the 'new messages' page.
Correct, so I would need to keep track of which link in the left frame they
had clicked on last, as well as the last state.
Of course, I don't know if these messages are completely contained in a
list, or you have to click on a link in a summary list to get a complete
form.
Messages are not completely contained within the list, just summary as you
specified. Full details can be found by clicking on the order number
assocaited within the message.

As I do not require sub second notification I quite like the idea of a
combination of your suggestions.
1. Lock the message, any other users will be notified that it is locked if
they try to act on it.
2. After processed udpate counts in left pane
3. Check for state change and update the right pane for any users that are
looking at "New" messages.

This may be more or less complicated than the applet. Presumably, even the
applet with its sub second notification would still need validation
procedures to ensure that two people did not simoultaneously try to act on
the same message.

I do not really know much about applets. Is it difficult to implement an
applet if its only purpose is to keep track of the last state?

Steve

"Sean Jorden" <s_***********@no.spam.n_o_r_a.d.a.com> wrote in message
news:Xn*********************@198.161.157.145... "Steve" <s@h.com> wrote in
news:E4*******************@news-server.bigpond.net.au:
Thanks Sean, you have understood the problem perfectly.
I am too new to Javascript to determine if this is possible. If it is,
then I would like to explain to a programmer I am working with how it
could be accomplished without use of an applet.


be warned it will not be possible to get *exactly* what you want in a
stateless (ie HTTP) environment. You need applets which are always
connected if you want sub-second notification. There are hacks you can
use by having a script driven HTML page load forever, spewing out
javascript directives based on server messages, but this can get dicey...
I think you can settle for Ebay-like currency of information here.

I was a bit worried about this too. I do have some Java Validation in
the back end that will not process messages that have already been
confirmed, but you are correct in declaring that the user would need
to be notified of this.


you could even go a step further by locking a message once a user has
merely opened it, but this creates at least 2 further issues,
1) a disagreeable user may lock many at once - you may have to program
limits
2) a user may open something and then forget about it, so you may have to
place time limits on the lock.

but that would make things extrememly current - another user knows the
state of a message as soon as they open it.

Of course, I don't know if these messages are completely contained in a
list, or you have to click on a link in a summary list to get a complete
form.

There is a visual cue although they may not notice it. The count in
the left pane would go from 10 to 9 (ie New(9)).

So if I address the risks above, do I take it that Javascript could
indeed manage to refresh the right pane for only those users who are
looking at the "New" pane?
Can the left pane hold some sort of flag variable (example flag=frame,
where frame could be new,history etc). then when it checks the server
every couple of seconds if someone has processed a "New" message the
right frame can be refreshed?


if you stored the last state - ie date/time and count (you need date as
well because a message could arrive and have been processed since last
refresh, so count would be the same) then you could know if things
changed in reality and make it bright red or something.

I would store those variables in hidden form fields and then re-submit to
server every x seconds.

again, I personally wouldn't refresh the right pane with javascript but
instead let the users know that the information they are looking at isn't
current and they need to click on the left pane again.

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fabian | last post by:
This javascript is meant for learning language vocabulary, specifically colours on this example. However, when I use images in the mtWord array, it breaks when checking for correct answers. It...
2
by: RootShell | last post by:
Hello First of all i know that PHP is a server side, and JavaScript is a Client side programming language, but i need to know if there is any way i can add the variable "countDownInterval" from...
7
by: Jean Pierre Daviau | last post by:
Hi, <script language="javascript" type="text/javascript"> if(navigator.appName.indexOf("Netscape") != -1){ document.writeln('<link rel="stylesheet" href="~styles/aquarelle_ns.css"...
1
by: IkBenHet | last post by:
Hello, Currently I am using a large input form on a website that is based on ASP and JavaScript. Depending on the values that are filled in by the user the forms does a refresh and makes...
4
by: batista | last post by:
Hello All, my prob. is that i have a web server, and i want it to send fresh data,whenver it is available(from sum other source), to a webpage. Now i used refresh, but i want to use an...
5
by: ken | last post by:
Hi, I have two questions the first is: in the example below how can I call an event from within a statement, such as replace Stop1 with cmdStop1 which is a button on my form? My second question...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
1
by: helraizer1 | last post by:
Hi folks, and folkesses. I have a piece of java script for a dynamic menu (code below). <ilayer width=100% height=50 name="dep1" bgColor="#000000"> <layer name="dep2" width=100% height=50>...
2
by: Shaileshsharma | last post by:
Hi, I am putting a validation on textbox that when user enter the name the first letter of name become capital. for this i make a function in javascript and call this function on my aspx...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.