-
1. Re: ajax ui feedback (hourglass, throbbing, input disable)
shadowcreeper Aug 18, 2008 2:37 PM (in response to gnagy)Have a4j:status open a rich:modalPanel (this disables the rest of the page while waiting) on start. Before it does that, have it add a class to the body tag that sets the cursor CSS style, and removes it after hiding the modalPanel on stop.
-
2. Re: ajax ui feedback (hourglass, throbbing, input disable)
gnagy Aug 19, 2008 3:25 AM (in response to gnagy)Thanks for the tip. We finally came up with this solution:
function disableForm(formid) {
form = $(formid)
form.style.cursor = 'wait';
formElements = form.elements;
for(i = 0; i < formElements.length; i++){
formElements[ i].disabled = true;
}
}
function enableForm(formid) {
form = $(formid)
form.style.cursor = 'default';
formElements = form.elements;
for(i = 0; i < formElements.length; i++){
formElements[ i].disabled = false;
}
}
<a4j:status onstart="disableForm('#{formid}')" onstop="enableForm('#{formid}')">
...
</a4j:status>
Note, this will probably not work as expected if you have disabled form elements, because the javascript code will blindly enable them. This could be avoided with a marker value in the form control's class attribute. -
3. Re: ajax ui feedback (hourglass, throbbing, input disable)
shadowcreeper Aug 19, 2008 1:57 PM (in response to gnagy)That looks good.
Also, if you want a "processing" notice, then a rich:modalPanel also disables the rest of the page (we use an animated gif of a progress bar with the text "Processing request..." above it).
Of course, if you still want to be able to click on one of the page's other forms, the modalPanel will not work for you.