But we dont really know if a converter is provided
and how it is provided
you still can have that converter registered globally

If we would fix that we should somehow always call getConverter(Class)
and then the default 1 (if class is null?) should call back something of the
formcomponent
that does then what we do now.

something like

FormComponent.getConverter(Class clz)
{
 if (clz == null)
  {
    return new IConverrter()
    {
             convertToObject()
             {
                    // call what now convertInput does
                   return convertValue(getInputAsArray());
             }
    }
  }
  return super.getConverter(Class clz)
}

this way convertInput only have to call getConverter(type).convertToObject()

then getConverter() is always called.
But i dont know if that is really for the better
and what pittfalls we have because of that

johan

On Mon, Mar 10, 2008 at 11:55 PM, <[EMAIL PROTECTED]> wrote:

> I missed this one. That explains what I just posted.
> I'd say the logic could be
> if a converter is provided, the its stringtoobject is
> called. otherwise, check the set type and use the types'registered
> converter.
>
> >yes i think i explained that before
> >the first call you see is the getConverter call that calls
> objectToString()
> >on it
> >but if type is not set on a field getConverter is not called for
> >StringToObject
> >
> >johan
> >
> >
> >
> >On Mon, Mar 10, 2008 at 11:44 PM, <[EMAIL PROTECTED]> wrote:
> >
> >> Yes, but the issue I encountered that wicket first
> >>  call getConverter method, yet not using
> >> what was returned as supposed to be. Class based
> >> converter is a way to write one default converter
> >> for one class, but if a special converter is provided
> >> for a subset of that class, then the special convert should be used
> >>
> >> >yes, since the converter interface now has
> >> >
> >> >convertToObject(String value);
> >> >convertToString(Object value);
> >> >
> >> >not just a single convertTo(Object object, Class type)
> >> >
> >> >it makes it rather explicit that the converter is meant to convert
> >> >something to a string and back...no?
> >> >
> >> >-igor
> >> >
> >> >
> >> >On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
> >> ><[EMAIL PROTECTED]> wrote:
> >> >> On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg <
> [EMAIL PROTECTED]>
> >> >wrote:
> >> >>
> >> >> > i thought we agreed converters were type converters...
> >> >>
> >> >>  Did we? :-)
> >> >>
> >> >>  Eelco
>  >> >>
> >> >>
> >> >>
> >> >>
>  ---------------------------------------------------------------------
> >> >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> >>  For additional commands, e-mail: [EMAIL PROTECTED]
> >> >>
> >> >>
> >> >
> >> >---------------------------------------------------------------------
> >> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> >For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to