Re: problem with ajax buttons + fields with AjaxFormComponentUpdatingBehavior

2013-07-24 Thread Martin Grigorov
On Tue, Jul 23, 2013 at 6:44 PM, Andrew Geery andrew.ge...@gmail.comwrote:

 Just to make sure I'm understanding this correctly, it should be enough to
 simply override updateAjaxAttributes on AjaxButton and specify a channel
 that does not have ACTIVE behavior, like this:

  @Override
 protected void updateAjaxAttributes(AjaxRequestAttributes
 attributes) {
 super.updateAjaxAttributes(attributes);
 attributes.setChannel(new AjaxChannel(MyChannel,
 AjaxChannel.Type.DROP));
 }


The default channel type is QUEUE, so it should work by default.
I cannot say why it doesn't in your case.



 Thanks
 Andrew


 On Tue, Jul 23, 2013 at 3:46 AM, Martin Grigorov mgrigo...@apache.org
 wrote:

  HI,
 
  Unless you use AjaxChannel.ACTIVE on the AjaxButton you should not
  experience this behavior.
  It should work exactly as you expect it.
  Try to put some debug statements with an AjaxCallListener - print to
  console in onBefore() and onBeforeSend(). Add this listener to both
  components - the field and the button.
 
 
  On Tue, Jul 23, 2013 at 5:03 AM, Andrew Geery andrew.ge...@gmail.com
  wrote:
 
   I have a form that is submitted with an AjaxButton.  One of the fields
 in
   the form uses an AjaxFormComponentUpdatingBehavior to update the
   server-side state when a value in the field changes (i.e., it fires
   onchange).  If the user changes the field with
   the AjaxFormComponentUpdatingBehavior associated with it and then
 clicks
   the submit button, the behavior updates the field server side, but the
  ajax
   button doesn't submit the form.  The user has to click the submit
 button
  a
   second time to submit the form.  Is there a way to get the two ajax
   behaviors to fire consecutively, rather than forcing the user to click
   twice?
  
   Thanks
   Andrew
  
 



Re: problem with ajax buttons + fields with AjaxFormComponentUpdatingBehavior

2013-07-24 Thread Andrew Geery
The problem is the ajax-loader-mask.  As per this posting (
http://stackoverflow.com/questions/12403999/jquery-click-event-doesnt-work-after-change-event),
the click happens (but no js click event yet), the js change event is sent
for the modified form field, Wicket handles the change event, the
ajax-loader-mask is displayed, which causes focus to be lost on the
link/button and the js click event is never fired, so Wicket only gets one
event.  If I remove the IAjaxIndicatorAware.getAjaxIndicatorMarkupId(),
which is supplying the ajax-loader-mask, the two events do get queued
correctly.

The solution is to keep the ajax indicator on the button but to remove it
from the form fields.

Thanks
Andrew



On Wed, Jul 24, 2013 at 2:47 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 On Tue, Jul 23, 2013 at 6:44 PM, Andrew Geery andrew.ge...@gmail.com
 wrote:

  Just to make sure I'm understanding this correctly, it should be enough
 to
  simply override updateAjaxAttributes on AjaxButton and specify a channel
  that does not have ACTIVE behavior, like this:
 
   @Override
  protected void updateAjaxAttributes(AjaxRequestAttributes
  attributes) {
  super.updateAjaxAttributes(attributes);
  attributes.setChannel(new AjaxChannel(MyChannel,
  AjaxChannel.Type.DROP));
  }
 

 The default channel type is QUEUE, so it should work by default.
 I cannot say why it doesn't in your case.


 
  Thanks
  Andrew
 
 
  On Tue, Jul 23, 2013 at 3:46 AM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   HI,
  
   Unless you use AjaxChannel.ACTIVE on the AjaxButton you should not
   experience this behavior.
   It should work exactly as you expect it.
   Try to put some debug statements with an AjaxCallListener - print to
   console in onBefore() and onBeforeSend(). Add this listener to both
   components - the field and the button.
  
  
   On Tue, Jul 23, 2013 at 5:03 AM, Andrew Geery andrew.ge...@gmail.com
   wrote:
  
I have a form that is submitted with an AjaxButton.  One of the
 fields
  in
the form uses an AjaxFormComponentUpdatingBehavior to update the
server-side state when a value in the field changes (i.e., it fires
onchange).  If the user changes the field with
the AjaxFormComponentUpdatingBehavior associated with it and then
  clicks
the submit button, the behavior updates the field server side, but
 the
   ajax
button doesn't submit the form.  The user has to click the submit
  button
   a
second time to submit the form.  Is there a way to get the two ajax
behaviors to fire consecutively, rather than forcing the user to
 click
twice?
   
Thanks
Andrew
   
  
 



Re: problem with ajax buttons + fields with AjaxFormComponentUpdatingBehavior

2013-07-23 Thread Martin Grigorov
HI,

Unless you use AjaxChannel.ACTIVE on the AjaxButton you should not
experience this behavior.
It should work exactly as you expect it.
Try to put some debug statements with an AjaxCallListener - print to
console in onBefore() and onBeforeSend(). Add this listener to both
components - the field and the button.


On Tue, Jul 23, 2013 at 5:03 AM, Andrew Geery andrew.ge...@gmail.comwrote:

 I have a form that is submitted with an AjaxButton.  One of the fields in
 the form uses an AjaxFormComponentUpdatingBehavior to update the
 server-side state when a value in the field changes (i.e., it fires
 onchange).  If the user changes the field with
 the AjaxFormComponentUpdatingBehavior associated with it and then clicks
 the submit button, the behavior updates the field server side, but the ajax
 button doesn't submit the form.  The user has to click the submit button a
 second time to submit the form.  Is there a way to get the two ajax
 behaviors to fire consecutively, rather than forcing the user to click
 twice?

 Thanks
 Andrew



Re: problem with ajax buttons + fields with AjaxFormComponentUpdatingBehavior

2013-07-23 Thread Andrew Geery
Just to make sure I'm understanding this correctly, it should be enough to
simply override updateAjaxAttributes on AjaxButton and specify a channel
that does not have ACTIVE behavior, like this:

 @Override
protected void updateAjaxAttributes(AjaxRequestAttributes
attributes) {
super.updateAjaxAttributes(attributes);
attributes.setChannel(new AjaxChannel(MyChannel,
AjaxChannel.Type.DROP));
}

Thanks
Andrew


On Tue, Jul 23, 2013 at 3:46 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 HI,

 Unless you use AjaxChannel.ACTIVE on the AjaxButton you should not
 experience this behavior.
 It should work exactly as you expect it.
 Try to put some debug statements with an AjaxCallListener - print to
 console in onBefore() and onBeforeSend(). Add this listener to both
 components - the field and the button.


 On Tue, Jul 23, 2013 at 5:03 AM, Andrew Geery andrew.ge...@gmail.com
 wrote:

  I have a form that is submitted with an AjaxButton.  One of the fields in
  the form uses an AjaxFormComponentUpdatingBehavior to update the
  server-side state when a value in the field changes (i.e., it fires
  onchange).  If the user changes the field with
  the AjaxFormComponentUpdatingBehavior associated with it and then clicks
  the submit button, the behavior updates the field server side, but the
 ajax
  button doesn't submit the form.  The user has to click the submit button
 a
  second time to submit the form.  Is there a way to get the two ajax
  behaviors to fire consecutively, rather than forcing the user to click
  twice?
 
  Thanks
  Andrew
 



Re: problem with ajax buttons + fields with AjaxFormComponentUpdatingBehavior

2013-07-23 Thread Andrew Geery
Looking in the Wicket Debug Window, I do see the name of my channel and I
do see that it is set to Queue (MyChannel|s).

(function(){Wicket.Ajax.ajax({f:form563,u:./1478314?11-1.IBehaviorListener.2-contactDetailsPanel-contactDetailsTabbedPanel-tabbedPanel-panel-modalForm-modal-content-wizard-form-view-wrapper-form-Save,e:click,c:Save564,sc:modal:content:wizard:form:view:wrapper:form:Save,ch:MyChannel|s,m:POST,i:ajax-loader-mask});})();

I'm currently using Wicket 6.7.

Does this not work because either a) it's in a modal window? or b) there is
an ajax-loader-mask?

Thanks
Andrew


On Tue, Jul 23, 2013 at 11:44 AM, Andrew Geery andrew.ge...@gmail.comwrote:

 Just to make sure I'm understanding this correctly, it should be enough to
 simply override updateAjaxAttributes on AjaxButton and specify a channel
 that does not have ACTIVE behavior, like this:

  @Override
 protected void updateAjaxAttributes(AjaxRequestAttributes
 attributes) {
 super.updateAjaxAttributes(attributes);
 attributes.setChannel(new AjaxChannel(MyChannel,
 AjaxChannel.Type.DROP));
 }

 Thanks
 Andrew


 On Tue, Jul 23, 2013 at 3:46 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 HI,

 Unless you use AjaxChannel.ACTIVE on the AjaxButton you should not
 experience this behavior.
 It should work exactly as you expect it.
 Try to put some debug statements with an AjaxCallListener - print to
 console in onBefore() and onBeforeSend(). Add this listener to both
 components - the field and the button.


 On Tue, Jul 23, 2013 at 5:03 AM, Andrew Geery andrew.ge...@gmail.com
 wrote:

  I have a form that is submitted with an AjaxButton.  One of the fields
 in
  the form uses an AjaxFormComponentUpdatingBehavior to update the
  server-side state when a value in the field changes (i.e., it fires
  onchange).  If the user changes the field with
  the AjaxFormComponentUpdatingBehavior associated with it and then clicks
  the submit button, the behavior updates the field server side, but the
 ajax
  button doesn't submit the form.  The user has to click the submit
 button a
  second time to submit the form.  Is there a way to get the two ajax
  behaviors to fire consecutively, rather than forcing the user to click
  twice?
 
  Thanks
  Andrew
 





problem with ajax buttons + fields with AjaxFormComponentUpdatingBehavior

2013-07-22 Thread Andrew Geery
I have a form that is submitted with an AjaxButton.  One of the fields in
the form uses an AjaxFormComponentUpdatingBehavior to update the
server-side state when a value in the field changes (i.e., it fires
onchange).  If the user changes the field with
the AjaxFormComponentUpdatingBehavior associated with it and then clicks
the submit button, the behavior updates the field server side, but the ajax
button doesn't submit the form.  The user has to click the submit button a
second time to submit the form.  Is there a way to get the two ajax
behaviors to fire consecutively, rather than forcing the user to click
twice?

Thanks
Andrew