i thought we agreed converters were type converters...so they shouldnt
be invoked if you are doing string->string :|

-igor


On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> call setTYpe(String.class) on the textfield
>  or use that constructor with the type param
>
>  does that help?
>
>
>
>  On Sun, Mar 9, 2008 at 1:35 PM, <[EMAIL PROTECTED]> wrote:
>
>  > Below is a custom component with overrding the getConverter
>  > for testing purpose. As you could see, it is plain simple one
>  > with simple output debugging. But it is not working.
>  > the getConverter is called (output "here")
>  > but the convertToObject never called (no "there")
>  > I basically cut and paste the WicketinAction example.
>  > What I am doing wrong here?
>  >
>  >
>  > public class RequiredUppperCaseTextField extends TextField {
>  >
>  >    public RequiredUppperCaseTextField(String id) {
>  >        super(id);
>  >        setRequired(true);
>  >
>  >    }
>  >    @Override
>  >    public final IConverter getConverter(Class arg000){
>  >        System.out.println("here"+ arg0);
>  >       IConverter icAppend = new IConverter(){
>  >
>  >            public Object convertToObject(String arg0, Locale arg1) {
>  >                System.out.println("there"+ arg0);
>  >                String s = "sss";
>  >                return s;
>  >            }
>  >
>  >            public String convertToString(Object arg0, Locale arg1) {
>  >                return (String)arg0;
>  >            }
>  >
>  >        };
>  >        return icAppend;
>  >     }
>  >
>  > }
>  >
>  >
>  > >Override the getConverter() method. First call super and with that
>  > >result call the special one (camel casing?)
>  > >
>  > >On 3/9/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > >> Hello:
>  > >> I wonder how to "append" a converter or java method to a component so
>  > that
>  > >I
>  > >> would affect what is already defined. For example, I want "camelize" a
>  > >> TextField(or some customized subclass) so that after the converter
>  > already
>  > >> defined completes the conversion (regardless what has been done in the
>  > >> chain) , I could use the added converted/method to make the final
>  > >conversion
>  > >> to my need. The example I am seeing appears to "overide" and only one
>  > can
>  > >be
>  > >> defined for a component, unlike validators, that I could add a chain of
>  > >> them. Let me know if I am wrong about this.
>  > >> Thanks
>  > >
>  > >---------------------------------------------------------------------
>  > >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