how do you map the String work to a phone class anyway?

i guess it could be like this:

class Person
{
 Phone work;
 Phone cell;
}

Then i could understand the example But currently i don't see how
to "convert" the string work to a Phone object that has 3 strings..

johan


On 12/14/06, Jonathan Sharp <[EMAIL PROTECTED]> wrote:

I have a Page level Model:
class Person {
   String work;
   String cell;
}

I have a component such as:
class PhoneNumber extends Panel {
    class Phone {
        String one;
        String two;
        String three;

        public String toString() {
            return one + two + three;
        }
    }

    public PhoneNumber(String id, IModel m) {
        super(id, new Model(new Phone()));
        TextField one = new TextField("one", new
PropertyModel(getModelObject(), "one"));
        TextField two = new TextField("two", new
PropertyModel(getModelObject(), "two"));
        TextField three = new TextField("three", new
PropertyModel(getModelObject(), "three"));
    }
}

On my page I'm doing:
Person p = new Person();
new PhoneNumber("workInput", new PropertyModel(p, "work"));
new PhoneNumber("cellInput", new PropertyModel(p, "cell"));


So how do I map the internal model for my panel ("Phone") to the passed in
model?

Cheers,
-js

-------------------------------------------------------------------------
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
Wicket-user@lists.sourceforge.net
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to