Well I got an Overridden PropertyModel to give me the behavior I want, but it
seems kind of dangerous.  Hoping there's a better way to accomplish this.

public class NegativePropertyModel extends PropertyModel {
  
  public NegativePropertyModel(final Object modelObject, final String
expression) {
                super(modelObject, expression);
  }

  @Override
  public Object getObject() {
    if(super.getObject() != null) {
      return !((Boolean)super.getObject()).booleanValue();
    }
    return null;
  }
  
  @Override
  public void setObject(Object o) {
    if(o instanceof Boolean) {
      super.setObject(o);
    }
  }
}
-- 
View this message in context: 
http://www.nabble.com/Reversing-checkbox-behavior-or-negating-a-property-model-expression-tp23218428p23218913.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to