As you probably know by now, I am not against using a converter as I
have always viewed converters as input/output converters rather than
'just' type converters. However, in 1.2.x and 1.3 until Johan
backports the converters from 2.0 this is awkward to achieve, so
Igor's approach works best. If you want to look at an example with
converters look at the FormInput example (URL and US phone number). I
would probably prefer converters in 2.0 as they make no assumptions on
the kind of model you are using.
Foo. Bar.
Eelco
On 2/28/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> why use a type converter? you are not converting types...
>
> i would use a model to do this
>
> class addrlinemodel implements imodel<string> {
> private imodel addrmodel;
>
>
> public String getobject() {
> address addr=addrmodel.getobject();
> return addr.streetnumber+" "+addr.streetname....;
> }
> public void setobject(String object) {
> address addr=addrmodel.getobject();
> string[] parts=object.split();
> //decide what goes where
> addr.streetname=parts[2];
> ...
> }
> }
>
> -igor
>
>
>
> On 2/28/07, Flemming Boller <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi
> >
> > I have a challenge about creating a reuseable Panel for my pojo called
> Address.
> >
> > class Address {
> >
> > String streetName;
> > String streetNumber;
> > String floor;
> > String letter;
> > String door;
> > String zipCode;
> > String city;
> > }
> >
> >
> > What I would like is to concatenate streetName, streetNumber, floor,
> letter, door into ONE textfield (wicket:id="address")
> > ZipCode and city have their own TextFields and PropertyModel is used here.
> >
> >
> > For concatening the fields above I have used a ITypeConverter, which
> converts the one textfield into an new Address object.
> > My problem is that the zipCode and city is bound to the old object, so the
> new Address object is missing the zipCode and city.
> >
> >
> > Do any of you guys know a solution to this problem? Should I use a
> ITypeConverter at all? Or should I take a whole other approch.
> >
> >
> > Regards
> > Flemming
> >
> >
> -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> > opinions on IT & business topics through brief surveys-and earn cash
> >
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user