Undo radio box click, rollback previous state

T

tedqn

I have a form with checkboxes and radio buttons which, onClick, run an
XmlHttp call to retrieve sub questions for that particular box (AJAX).
The problem is if user click on several boxes too fast, it cancel
previous calls that haven't been completed. For checkboxes, I can
detect that XmlHttp process is still running for another checkbox and
prevent the call plus uncheck that box. However, for radio boxes, I
have no way of knowing what the previous selection was to restore the
previous selection while the process is still running to retrieve sub
questions for the previous selection. Ideally, I'm looking for a way to
freeze the screen while the process is running or just something that
makes the radio/checkbox click has no effect at all, ie. not checked.
Any advice appreciated.
 
T

Thomas 'PointedEars' Lahn

I have a form with checkboxes and radio buttons which, onClick, run an
XmlHttp call to retrieve sub questions for that particular box (AJAX).
The problem is if user click on several boxes too fast, it cancel
previous calls that haven't been completed. [...] Ideally, I'm looking
for a way to freeze the screen while the process is running or just
something that makes the radio/checkbox click has no effect at all,
ie. not checked.

No, you most certainly don't. That would counteract the advantages of
asynchronous HTTP requests like requesting from the server every time
a control changes does. Include an Apply button and use synchronous
requests if you must.
Any advice appreciated.

You're welcome.


PointedEars
 
D

David Wahler

I have a form with checkboxes and radio buttons which, onClick, run an
XmlHttp call to retrieve sub questions for that particular box (AJAX).
The problem is if user click on several boxes too fast, it cancel
previous calls that haven't been completed.

Why not just set a global variable to indicate that there's a request
outstanding, and have your event handlers ignore any actions taken
until it finishes?

-- David
 
T

tedqn

Like I said, I already know there's a request currently in process.
What I'm trying to figure out is how to "cancel" completely. I can
cancel the subsequent requests but the effect already takes place - the
checkbox/radio box gets checked even though no subquestions retrieved
for them. User will have to uncheck and recheck the box in order to
trigger the request again. I'm thinking about the "stack" method ....
putting requests in a stack and pull out one item at a time to run to
finish, then pull the next item from the stack..
 
R

RobG

Like I said, I already know there's a request currently in process.
What I'm trying to figure out is how to "cancel" completely. I can
cancel the subsequent requests but the effect already takes place - the
checkbox/radio box gets checked even though no subquestions retrieved
for them. User will have to uncheck and recheck the box in order to
trigger the request again. I'm thinking about the "stack" method ....
putting requests in a stack and pull out one item at a time to run to
finish, then pull the next item from the stack..

I think Thomas is right, but if you insist...

You could try disabling the radio buttons onclick, submit the request
and re-enable them when the request returns.

Make sure you include UI hints so that users have some idea why stuff
stops working from time-to-time for some indeterminate period.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top