final Form form...;

add(new WebMarkupContainer("form-error") { isvisible() { return
form.hasError(); }});
<div wicket:id="form-error">Form contains errors</div>

^wrap in a panel instead of wmc to make reusable

class ErrorHighglither extends AbstractBehavior {
private FormComponent fc;
public void bind(Component c) {
      /// check c is formcomponent
       this.fc=(formcomponent)c;
 }
 public void oncomponenttag(tag) {
     if (!fc.isvalid()) { tag.put("class", "error"); }
 }
}

new TextField("foo").add(new ErrorHighglighter(); }

-igor


On 1/19/07, Timo Rantalaiho <[EMAIL PROTECTED]> wrote:

On Fri, 19 Jan 2007, [EMAIL PROTECTED] wrote:
> message. In other words I can not use the build in valdiation by itself
> since all those fields by themselves are fine but their combination is
not
> valid. ANd the business wants to see jsut one error message on top, but
> have all of the fields that failed validation highlighted. What would
you
> suggest is a best way to approach it.

I would look at Form.add(IFormValidator validator).

To put a common error message at top, just add a FeedbackPanel
that is a direct child of the form.

- Timo

--
Timo Rantalaiho
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to