I used this AttributeAppender technique as well (although I tested for component#hasErrorMessage() instead ) and you can use an IVisitor from a base page to add this behavior to all of your form components automatically

Aaron


On Wed, 2006-07-12 at 23:52 -0700, Igor Vaynberg wrote:
dont quote me but...

class ErrorHighlighter extends AttributeAppender {
 private FormComponent fc;

  public ErrorHighlighter() {
       super("style", true, "background-color:red;", " ");
   }

  public void bind(Component c) { fc=(FormComponent)c; }

   public boolean isEnabled() { return !fc.isValid(); }
}

and then

formcomponent.add(new ErrorHighlighter());

-Igor


On 7/12/06, JK <[EMAIL PROTECTED]> wrote:
Hi,

Is it possible to hilight erroneus form field? If textfield data is
not valid how do you change field background color?

Thanks!


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to