Re: AjaxChannel Queues

2013-06-20 Thread Jered Myers

Thanks!

On 06/20/2013 01:08 PM, Sven Meier wrote:

The Javascript in the response is evaluated as part of the ajax call.

>I need to know if the finishButtonWork function call would happen 
before or after the AjaxChannel releases the next ajax request from 
queue.


Before.

Sven

On 06/20/2013 07:48 PM, Jered Myers wrote:
I am having a few challenges with the AjaxChannel queuing up and 
interfering with actions a user is making while in ajax requests are 
in queue.  When my AbstractDefaultAjaxBehavior hits its respond 
method, it adds a JavaScript call to the target. Does that JavaScript 
get executed before the next ajax request is release from the 
AjaxChannel queue?


In my example below, the user would be clicking the button fast 
enough to queue the AjaxChannel.  I need to know if the 
finishButtonWork function call would happen before or after the 
AjaxChannel releases the next ajax request from queue.


// HTML


// JavaScript
callbackForBehavior = function() {
  Wicket.Ajax.ajax({blah});
}
getButtonDetails = function() {
...
return buttonDetailsJSON;
}
finishButtonWork = function(json) {

}

// Java AbstractDefaultAjaxBehavior
protected void updateAjaxAttributes(AjaxRequestAttributes attribs){
super.updateAjaxAttributes(attribs);

// Call the function that sets up the parameters to pass back 
to the server.
attribs.getDynamicExtraParameters().add("return 
getButtonDetails();");

}
protected void respond(AjaxRequestTarget target) {
...
target.appendJavaScript("finishButtonWork(" + resultJSON + ");");
}




-
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: AjaxChannel Queues

2013-06-20 Thread Sven Meier

The Javascript in the response is evaluated as part of the ajax call.

>I need to know if the finishButtonWork function call would happen 
before or after the AjaxChannel releases the next ajax request from queue.


Before.

Sven

On 06/20/2013 07:48 PM, Jered Myers wrote:
I am having a few challenges with the AjaxChannel queuing up and 
interfering with actions a user is making while in ajax requests are 
in queue.  When my AbstractDefaultAjaxBehavior hits its respond 
method, it adds a JavaScript call to the target. Does that JavaScript 
get executed before the next ajax request is release from the 
AjaxChannel queue?


In my example below, the user would be clicking the button fast enough 
to queue the AjaxChannel.  I need to know if the finishButtonWork 
function call would happen before or after the AjaxChannel releases 
the next ajax request from queue.


// HTML


// JavaScript
callbackForBehavior = function() {
  Wicket.Ajax.ajax({blah});
}
getButtonDetails = function() {
...
return buttonDetailsJSON;
}
finishButtonWork = function(json) {

}

// Java AbstractDefaultAjaxBehavior
protected void updateAjaxAttributes(AjaxRequestAttributes attribs){
super.updateAjaxAttributes(attribs);

// Call the function that sets up the parameters to pass back 
to the server.
attribs.getDynamicExtraParameters().add("return 
getButtonDetails();");

}
protected void respond(AjaxRequestTarget target) {
...
target.appendJavaScript("finishButtonWork(" + resultJSON + ");");
}




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



AjaxChannel Queues

2013-06-20 Thread Jered Myers
I am having a few challenges with the AjaxChannel queuing up and 
interfering with actions a user is making while in ajax requests are in 
queue.  When my AbstractDefaultAjaxBehavior hits its respond method, it 
adds a JavaScript call to the target.  Does that JavaScript get executed 
before the next ajax request is release from the AjaxChannel queue?


In my example below, the user would be clicking the button fast enough 
to queue the AjaxChannel.  I need to know if the finishButtonWork 
function call would happen before or after the AjaxChannel releases the 
next ajax request from queue.


// HTML


// JavaScript
callbackForBehavior = function() {
  Wicket.Ajax.ajax({blah});
}
getButtonDetails = function() {
...
return buttonDetailsJSON;
}
finishButtonWork = function(json) {

}

// Java AbstractDefaultAjaxBehavior
protected void updateAjaxAttributes(AjaxRequestAttributes attribs){
super.updateAjaxAttributes(attribs);

// Call the function that sets up the parameters to pass back 
to the server.
attribs.getDynamicExtraParameters().add("return 
getButtonDetails();");

}
protected void respond(AjaxRequestTarget target) {
...
target.appendJavaScript("finishButtonWork(" + resultJSON + ");");
}

--
Jered Myers