Are you using wicket 1.3?
Then you can add a person convertor (toObject/toString)
But a txt field for the complete person that sounds very strange.
What do you want to edit?? Do yu want to  choose a person? Or do you
want to edit a preoperty of that person?



On 11/28/07, Pills <[EMAIL PROTECTED]> wrote:
>
>
> Johan Compagner wrote:
> >
> > Converters are (in 1.3 especially) are String -> X (or X -> String)
> >
> > so browser string input converted to a model value.
> > So how do you already get an integer? Because that should be converted by
> > a
> > converter already.
> >
> > johan
> >
>
> Well, I wrote this code:
> person = new TextField("person", new PropertyModel(formTarget, "person"),
> Integer.class)
>
> So it accepts only integers... but I guess it's wrong, I'd better to write
> this
> person = new TextField("person", new PropertyModel(formTarget, "people"),
> Person.class)
>
> But in that case, I don't know how to convert the browser string to a
> model's object and the model's object to a string (representing it's foreign
> key). I've overriden the field's "convertInput" method, so now it's able to
> convert string -> Person (I don't know if it's the right way). But for the
> other conversion I don't know what to override....
>
>
> Thank you for your help ;)
> --
> View this message in context:
> http://www.nabble.com/Use-a-custom-converter-%28IntegerToMyClass%29-tf4887609.html#a13991029
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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