As I remember, wicket trims spaces already, so you don't need do
anything special about it.

For DB, if you use hibernate (or if not, anyway you should have data
objects for your business entities), you can have something like that:
public class MyEntity
{
// This is mapped to database, but not for public, only database will use it.
  private String siteUrlStr;
// this is your public interface:
  public SiteUrl getSiteUrl(){return new SiteUrl(getSiteUrlStr());}
  public void setSiteUrl(SiteUrl url){siteUrlStr = url.getStr();}
}

And in code the lists should be treated as List, Collection or so, not
as comma-separated strings (only in some particular places like
persisting in database or in user interface).

2008/12/11 pixologe <[EMAIL PROTECTED]>:
>
> Thanks for your ideas...
>
> But.... huh... is there really no "wicket way" to achieve this?
>
> After all I would not think that it is uncommon to fix simple things in user
> input before validation, e.g. trim strings, discard empty items in comma
> separated lists etc.
>
> Your solutions would work both I think, I just do not like the idea of doing
> things like these with javascript.
> Also, retrieving a String value from DB and wrapping it into an object just
> in order to be able to convert it back does not seem right to me...
>
> I'll probably stick to the js solution (reluctantly ;-), but if there is
> really no elegant way, I would love to see one in future wicket versions.
>
> Thanks for inspiration!
> best regards
> --
> View this message in context: 
> http://www.nabble.com/Modify-textfield-input-before-validation-tp20952903p20956050.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
WBR, kan.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to