Hi Cliff,

If I read your requirements correctly you should use "onkeypress" 
instead of "onblur". But I guess you already guessed that.

Regards,
    Erik.

Martijn Dashorst wrote:
> You make it very complicated :-)
>
> final TextField uname = new TextField("username", ...).add(new
> AttributeModifier("class", true, new Model() { public void
> getObject(Component c) { return uname.isValid() ? "valid" : "invalid";
> } });
>
> uname.add(new AjaxFormComponentUpdateBehavior("onblur") {
>     public void onUpdate(AjaxRequestTarget target) {
>         if(!uname.isValid()) {
> target.appendJavaScript("document.getElementById('" +
> uname.getMarkupId() + "').focus();"); }
>         target.addComponent(uname);
>     }
> });
>
> Should do the trick. Note that this is from the top of my head, so
> things might not compile completely.
>
> Martijn
>   

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to