473,748 Members | 8,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4455
"Steve" <s@h.com> wrote in
news:dY******** ***********@new s-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******** ***********@new s-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******** ************@19 8.161.157.145.. . "Steve" <s@h.com> wrote in
news:dY******** ***********@new s-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******** ***********@new s-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******** *************@1 98.161.157.145. .. "Steve" <s@h.com> wrote in
news:E4******** ***********@new s-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
1668
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 works fine with text in those spaces. Direct links to the pages online: http://www.lajzar.co.uk/en/colours.html http://www.lajzar.co.uk/en/animals.html How can I fix this so the functions work with images in that array? It
2
5060
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 this particular FULL code into a MySQL field. Here's the drill: I have a timer on a PHP webpage, and i want to prevent the user from doing a
7
1889
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" type="text/css" media="screen" title="base" />'); }else{ document.write('<link rel="stylesheet" href="~styles/aquarelle.css" type="text/css" media="screen" title="base" />'); }
1
3259
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 other input fields available to fill in. I use the JavaScript OnChange function (=clientside) that creates a querystring and does a refresh of the page. It works fine.
4
3157
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 alternative. I heard that refresh is called pull scheme, and the one i'm looking for is caled push scheme.
5
1371
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 again deals with the example below. Shouldn't I see the valve of " i" counting away in the txtCount1 text box? I don't see anything in the text box and would like to know what I'm doing wrong. Thanks in advance for any and all help. Regards, Ken
10
3476
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 ------------- I have perl script which simply runs a ps on a Solaris server and generates a static html page with all of the code perfectly and this html page works fine when viewing it statically or with a META REFRESH header tag. The idea is to give the user...
1
4873
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> </layer> </ilayer> <div align="center" id="describe" style="background:#efefef;" onMouseover="clear_delayhide()" onMouseout="resetit(event); refresh();"></div>
2
1214
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 page like this txtName.Attributes.Add("onblur", "DispName()"); this is working fine but the prob. is this it refresh my webPage.Is there any way that my page get not refreshed .Please help me to solve my problem. Thanks Shailesh Kumar
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.