Re: AjaxFormComponentUpdatingBehavior Question

2010-10-11 Thread pjacobsma


meduolis wrote:
 
 Again, I can offer a hack :D
 
 public class DoSomeHackBehavior extends AbstractBehavior {
 
   private static final long serialVersionUID = 3554634545756435367L;
 
   @Override
   public void onComponentTag(Component component, ComponentTag tag) {
   FormComponent? comp = (FormComponent?) component;
   tag.getAttributes().remove(onblur);
   }
   }
   
 }
 
 after that, you can add this behaviour to any component
 
 component.add(new DoSomeHackBehaviour());
 
 :D
 
Thanks again.  But unfortunately the onblur Ajax called survived.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-Question-tp2968982p2990115.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



Re: AjaxFormComponentUpdatingBehavior Question

2010-10-11 Thread pjacobsma



Again, I can offer a hack :D

public class DoSomeHackBehavior extends AbstractBehavior {

private static final long serialVersionUID = 3554634545756435367L;

@Override
public void onComponentTag(Component component, ComponentTag tag) {
FormComponent? comp = (FormComponent?) component;
tag.getAttributes().remove(onblur);
}
}

}

after that, you can add this behaviour to any component

component.add(new DoSomeHackBehaviour());

:D

I have found that Wicket adds an onblur Ajax call to every HTML event you
can define for the AjaxFormComponentUpdatingBehavior on a DropDownChoice
control.  I haven't tested this on other controls.  This means your server
will be getting an extra Ajax call each time a user moves focus away from
the dropdown, even if they didn't change the dropdown selection.   This
seems like a bug.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-Question-tp2968982p2990266.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



Re: AjaxFormComponentUpdatingBehavior Question

2010-10-11 Thread pjacobsma

Doh!  Never mind.  I just discovered that buried in my Page was this piece of
code: AjaxFormValidatingBehavior.addToAllFormComponents(form,onblur);  
That's what was adding the onblur call to the dropdown.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-Question-tp2968982p2990385.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



Re: AjaxFormComponentUpdatingBehavior Question

2010-10-08 Thread meduolis

I dont know if it works, but you can try to make a hack :)

endDateDropDown = new DropDownChoiceDate(endDateDropDown, new
PropertyModel(viewHistoryCriteria, endDate),
ProcessDateContext.getSixtyDayRange());
endDateDropDown.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
if (criteriaDropDown.isEnabled()) {
populateCriteriaDropdown(target);
}
}
});
endDateDropDown.add(new AjaxFormComponentUpdatingBehavior(onblur) {
protected void onUpdate(AjaxRequestTarget target) {
// do nothing
}
});  
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-Question-tp2968982p2969013.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



Re: AjaxFormComponentUpdatingBehavior Question

2010-10-08 Thread pjacobsma


meduolis wrote:
 
 I dont know if it works, but you can try to make a hack :)
 
 endDateDropDown = new DropDownChoiceDate(endDateDropDown, new
 PropertyModel(viewHistoryCriteria, endDate),
 ProcessDateContext.getSixtyDayRange());
 endDateDropDown.add(new AjaxFormComponentUpdatingBehavior(onchange) {
 protected void onUpdate(AjaxRequestTarget target) {
 if (criteriaDropDown.isEnabled()) {
 populateCriteriaDropdown(target);
 }
 }
 });
 endDateDropDown.add(new AjaxFormComponentUpdatingBehavior(onblur) {
 protected void onUpdate(AjaxRequestTarget target) {
 // do nothing
 }
 });  
 
 

Thanks for your reply.  I tried your suggestion, but Wicket still wrote an
Ajax call for the onblur event.  I would like to eliminate that call.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-Question-tp2968982p2969030.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



Re: AjaxFormComponentUpdatingBehavior Question

2010-10-08 Thread meduolis

Again, I can offer a hack :D

public class DoSomeHackBehavior extends AbstractBehavior {

private static final long serialVersionUID = 3554634545756435367L;

@Override
public void onComponentTag(Component component, ComponentTag tag) {
FormComponent? comp = (FormComponent?) component;
tag.getAttributes().remove(onblur);
}
}

}

after that, you can add this behaviour to any component

component.add(new DoSomeHackBehaviour());

:D
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-Question-tp2968982p2969053.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