public class UpperCaseBehavior extends AttributeAppender
{
   private static final long serialVersionUID = 1L;

   public UpperCaseBehavior()
   {
       super("style", new Model<String>("text-transform: uppercase"), ";");
   }

   @Override
   public void bind(Component component)
   {
       super.bind(component);
       component.add(new AttributeAppender(
"onkeyup", new Model<String>("this.value = this.value.toUpperCase()"), ";"));
   }
}


Leszek Gawron escreveu:
Hello,

one of my customers has this weird requirement that all data should be input/shown uppercase. I can easily add

input {
  text-transform: uppercase;
}

to my css rules, but this does not change the fact that data written into database will still be case sensitive.

How can I create a behavior for TextField so that the dat is uppercased before being written to the model?

my regards


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

Reply via email to