[Wicket-user] colored labels in validation error
Hi, Is there a wicket standard way to have input label have a special style (e.g. color: red) when the corresponding input field validation fails? Thanx, Wouter - 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
Re: [Wicket-user] colored labels in validation error
field.add(new AttributeModifier("class", true, new Model() { public Object getObject(Component c) { return ((FormComponent)c).isValid() ? "" : "error"; } } ); Should work. Provided you do: .error { background-color : red; } in your stylesheet. Martijn On 3/17/07, Wouter de Vaal <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a wicket standard way to have input label have a special > style (e.g. color: red) when the corresponding input field validation > fails? > > Thanx, > Wouter > > - > 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 > -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - 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
Re: [Wicket-user] colored labels in validation error
Thanx. It works with the modification that getObject(Component c) is not a part of Model anymore in the wicket version that I use (a 2.0 snapshot). Wouter On 3/17/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote: > field.add(new AttributeModifier("class", true, new Model() { > public Object getObject(Component c) { > return ((FormComponent)c).isValid() ? "" : "error"; > } > } > ); > > Should work. Provided you do: > .error { background-color : red; } > in your stylesheet. > > Martijn > > On 3/17/07, Wouter de Vaal <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Is there a wicket standard way to have input label have a special > > style (e.g. color: red) when the corresponding input field validation > > fails? > > > > Thanx, > > Wouter > > > > - > > 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 > > > > > -- > Learn Wicket at ApacheCon Europe: http://apachecon.com > Join the wicket community at irc.freenode.net: ##wicket > Wicket 1.2.5 will keep your server alive. Download Wicket now! > http://wicketframework.org > > - > 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 > - 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
Re: [Wicket-user] colored labels in validation error
There's Martijns way but there are also some related components like FormComponentFeedbackBorder/Indicator or igor's FieldBorder (or it's something like that). Wouter De Vaal wrote: > > Hi, > > Is there a wicket standard way to have input label have a special > style (e.g. color: red) when the corresponding input field validation > fails? > > Thanx, > Wouter > > - > 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 > > -- View this message in context: http://www.nabble.com/colored-labels-in-validation-error-tf3419063.html#a9537001 Sent from the Wicket - User mailing list archive at Nabble.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