Is it possible to use a compound property model for a label?

I tried adding labels using the following, but when I run it,
the label comes out with what appears to be a reference to the
model.

            customer = new Customer();
            customer.setFirstName("Jimmy");
            customer.setLastName("Dean");
            customer.getAddress().setStreet("123 Easy Street");
            
            myModel = new CompoundPropertyModel<Customer>(customer);
            
            firstNameLabel = new Label("firstName",myModel);
            add(firstNameLabel);
            lastNameLabel = new Label("lastName",myModel);
            add(lastNameLabel);
            add(new Label("street.address", myModel))

Code                                            Result
firstName from Compound Property Model          com.brie.dtoo.Customer@7cb44d
lastName from Compound Property Model           com.brie.dtoo.Customer@7cb44d
street.address from Compound Property Model     com.brie.dtoo.Customer@7cb44d

brian
-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to