Re: Is it possible to register multiple behaviors for a field?

2009-07-12 Thread Martin Makundi
You could use ajax decorator which sort of appends callers.. I am not
exactly sure how in your particular situation, but you can try it out
and see how it works:

  public static final IAjaxCallDecorator BLUR_DECORATOR = new
IAjaxCallDecorator() {
public CharSequence decorateOnFailureScript(
CharSequence arg0) {
  return arg0;
}

public CharSequence decorateOnSuccessScript(
CharSequence arg0) {
  return arg0;
}

public CharSequence decorateScript(CharSequence arg0) {
  return "blur();" + arg0;
}
  };

Usage:
component.add(new
OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.addChildren(dailyContainer, DropDownChoice.class);
}
/**
* @see
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#getAjaxCallDecorator()
*/
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return BLUR_DECORATOR;
}
});

**
Martin

2009/7/12 Kenneth NA :
>
>
> I want to register two behaviors for a textfield, is this possible, as I only 
> see the result and call to one of them?
>
>
> This is what I am trying to do:
> textfield.add(new ComponentVisualErrorBehavior("onblur", tf));
> textfield.add(new AjaxFormComponentUpdatingBehavior("onblur") { ... }
>
>
>
> _
> Vårkänslor och pirr i magen? Hitta din drömpartner här!
> http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952

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



Is it possible to register multiple behaviors for a field?

2009-07-12 Thread Kenneth NA

 
I want to register two behaviors for a textfield, is this possible, as I only 
see the result and call to one of them? 


This is what I am trying to do: 
textfield.add(new ComponentVisualErrorBehavior("onblur", tf));
textfield.add(new AjaxFormComponentUpdatingBehavior("onblur") { ... }



_
Vårkänslor och pirr i magen? Hitta din drömpartner här!
http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952