Tab out vs. Mouse click

  • Thread starter Thread starter Prateek
  • Start date Start date
P

Prateek

Hi All,

I have created an ASP.NET page that basically consists of a table having
text boxes in all cells. The table is created using client side java script.
There are some calculations being done when user changes text in any text
box and moves to the next text box. This is done in the Text Changed event
in java script.
The problem that I am facing is that, if the user moves from one text box to
another using tab key, the performance is fine. However, if the user moves
from one text box to another using mouse click, the performance is lot
slower. It takes about 3-4 seconds for the cursor to reappear on the second
text box. Tab takes less than 1 second.

Can anybody throw some light on why this might be happening?

TIA
Prateek
 
Maybe if you provided code?

Are you sure anything's happening when they are simply tabbing? maybe none
of your client-side code is running? In other words maybe the problem is
really with the tabbing as opposed to the mouse (that's what I frst thought
anyways)..

Karl
 
Hi Prateek,

Without any example code this is a tough call. If you are using VS.Net or
running IE with debugging enabled I recommend you use the debugger; line.
This will halt execution of your javascript and let you step through it just
like you do your ASP.Net code behind. Then step through your code after a
tab out and after a mouse click and see what is going on. My guess is that
you are firing some javascript on both the Text Changed event and the
onclick event that is causing a different execution path to occur leading to
your bottleneck. Good luck! Ken.
 
many thanks for your insights Ken and Karl..
heres some more information:
- Only OnChange event is being used. no server side code is executed.. only
javascript
- this event fires only once for both tab and mouse click
- it takes around 270-350 milli seconds for the code in OnChange event to
execute for both mouse and tab. no other code is executed.
- however, for the user, it seems that tab takes 1 sec and mouse click 3-4
seconds. whats causing this extra time? I can submit the code but actually
there isn't anything else in the code except an onchange event handler.
- there are three frames on the page.. each frame has a table. each table
has about 100 text boxes.
it seems that the system itself is executing something thats taking this
extra time..
any suggestions?

thanks for any inputs that you can give!
 
Prateek:
I really don't have any idea. You might try cancelling the event after your
done processing. It might have undesirable side effects but it's really the
only thing I can suggest trying to figure it out:
http://www.webdevelopersjournal.com/articles/jsevents2/jsevents2.html
(different in IE and FireFox)

Perhaps the complexity of the frames/tables/boxes is what the problem
is...you could also simply dumb down the page to the core basics and if
that's fast, you can add functionality one at a time until you hit
something...poor man's debugging :(

Karl
 
Back
Top