Provide the user with immediate feedback

2011-02-01 Thread Patrick Petermair

Hey!

In our wicket application we are using a lot of Ajax links/forms. 
Sometimes, those requests take a second or two. We now want to give the 
user some feedback, that his request is being processed (to avoid double 
clicking or the impression that the webapp is slow).


What would be the best way to execute custom javascript methods BEFORE 
the request gets sent to the webapp? Those javascript methods would then 
show a progress bar, a message like Your request is being processed.. etc.


For example: The user clicks an AjaxLink to delete an entry from the 
table and before the request gets sent to the server, some javascript 
method adds a small progress bar at the top of the table. Once the ajax 
request is done, the progress bar disappears.


Another example would be how Facebook handles sending private messages. 
As soon as I click the send button, the text area gets disabled / 
greyed out immediately and after the Ajax request has gone through, I 
get access again to the text area.


Cheers,
Patrick

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Provide the user with immediate feedback

2011-02-01 Thread Pedro Santos
You can register an handler to show some message and another one to remove
it at the end of request. See Wicket.Ajax.registerPreCallHandler
/ registerPostCallHandler
and
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
On Tue, Feb 1, 2011 at 9:39 AM, Patrick Petermair 
patrick.peterm...@openforce.com wrote:

 Hey!

 In our wicket application we are using a lot of Ajax links/forms.
 Sometimes, those requests take a second or two. We now want to give the user
 some feedback, that his request is being processed (to avoid double clicking
 or the impression that the webapp is slow).

 What would be the best way to execute custom javascript methods BEFORE the
 request gets sent to the webapp? Those javascript methods would then show a
 progress bar, a message like Your request is being processed.. etc.

 For example: The user clicks an AjaxLink to delete an entry from the table
 and before the request gets sent to the server, some javascript method adds
 a small progress bar at the top of the table. Once the ajax request is done,
 the progress bar disappears.

 Another example would be how Facebook handles sending private messages. As
 soon as I click the send button, the text area gets disabled / greyed out
 immediately and after the Ajax request has gone through, I get access again
 to the text area.

 Cheers,
 Patrick

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos


Re: Provide the user with immediate feedback

2011-02-01 Thread Ernesto Reinaldo Barreiro
Patrick,

I think you can:

1-use interface IAjaxIndicatorAware to mark a page or Panel as a
context for showing some indicator of AJAX activity (usually a veil +
some activity icon)
2- or you can use IAjaxCallDecorator to manually decorate your links.

Ernesto

On Tue, Feb 1, 2011 at 12:39 PM, Patrick Petermair
patrick.peterm...@openforce.com wrote:
 Hey!

 In our wicket application we are using a lot of Ajax links/forms. Sometimes,
 those requests take a second or two. We now want to give the user some
 feedback, that his request is being processed (to avoid double clicking or
 the impression that the webapp is slow).

 What would be the best way to execute custom javascript methods BEFORE the
 request gets sent to the webapp? Those javascript methods would then show a
 progress bar, a message like Your request is being processed.. etc.

 For example: The user clicks an AjaxLink to delete an entry from the table
 and before the request gets sent to the server, some javascript method adds
 a small progress bar at the top of the table. Once the ajax request is done,
 the progress bar disappears.

 Another example would be how Facebook handles sending private messages. As
 soon as I click the send button, the text area gets disabled / greyed out
 immediately and after the Ajax request has gone through, I get access again
 to the text area.

 Cheers,
 Patrick

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Provide the user with immediate feedback

2011-02-01 Thread msj121

Interesting the Ajax call decorator mentioned above sounds like a good
choice, I don't know the transactional steps for each solution, but to have
the javascript written entirely in the page without requiring some sort of
connection to the wicket server, does sound like it will be more immediate
if your worried about that 1 or 2 seconds of idle time however you want to
accomplish that.
http://radio.javaranch.com/pascarello/2005/05/17/1116340367337.html If you
need a script: 
function DisableEnableForm(xForm,xHow){
  objElems = xForm.elements;
  for(i=0;iobjElems.length;i++){
objElems[i].disabled = xHow;
  }
}

Just my two cents,
Matthew




Patrick Petermair wrote:
 In our wicket application we are using a lot of Ajax links/forms. 
 Sometimes, those requests take a second or two. We now want to give the 
 user some feedback, that his request is being processed (to avoid double 
 clicking or the impression that the webapp is slow).

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Provide-the-user-with-immediate-feedback-tp3250978p3251879.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org