Re: [Wicket-user] question about date format for textfield

2007-04-27 Thread karthik Guru
try this .. public Object convert(Object value, Class c) { //If the value is already of the same type as 'c' //then return it if (c== value.getClass()){ return value; } On 4/27/07, kubino <[EMAIL PROTECTED]> wrote: Hi Johan, I tried

Re: [Wicket-user] question about date format for textfield

2007-04-27 Thread kubino
Hi Johan, I tried this TextField dateFrom = new TextField("dateFrom",new PropertyModel(filtr,"dateFrom")) { public IConverter getConverter() { return new IConverter() { public Object convert(Object value, Class c) { try { i

Re: [Wicket-user] question about date format for textfield

2006-03-23 Thread Eelco Hillenius
IConverter is a generic interface which is called for the ingoing and outgoing values. Last week, I added a convenience base class, and it's usage looks like this (from FormInput): add(new TextField("urlProperty", URL.class) { public IConverter getConverter() { return new SimpleConverterAd

Re: [Wicket-user] question about date format for textfield

2006-03-23 Thread Jaime De La Jara
Hi, thanks for the answer, but I don't understand why the convert method is called twice. On the other hand, is there any simpler way to work with a different date format? Just a comment I can't see my post in the mailing list, does it take too long? or I'm missing something?Thanks,Jaime

Re: [Wicket-user] question about date format for textfield

2006-03-23 Thread Johan Compagner
you have to test to which class the converter wants to go to:         public Object convert(Object o, Class c)         {      try    {     if(c == String.class)  

[Wicket-user] question about date format for textfield

2006-03-23 Thread Jaime De La Jara
Hi, I've been trying to develop an application with wicket, but I don't know how to customize the date format for a textfield. I'm using the DatePickercomponent but I use a different format : dd-MM-, when I submit the form an exception is thrown because the format is not recognized, I tried