Johan Compagner wrote:
Don't like it will generate a lot of more code.
And youre IQuery is just IModel:

        User user=new User();
        user.setName("James Bond");
        Group group=new Group();
        group.setName("secret");
        user.setGroup(group);

property way:
TextField tf = new TextField(id , new PropertyModel(user,"group.name <http://group.name>"));

(I)Model way (pretty much youre way)
        TextField tf = new TextField(id , new Model(user)
        {
                public public Object getObject(final Component component){
                    return ((User)model).getGroup()

    .getName();
                    }

                    public void setObject(final Component component,
    final Object value){
                        ((User)model).getGroup().setName((String)value);
                    }

      });

then i prefer the property model

johan
Oh yeah, you're right. Why I haven't noticed that before. IQuery would only make it possible to make the code a little bit shorter, but it's not really worth the effort.

I'll throw away all my PropertyModels, they really make the code shorter, but otherwise suck really badly.

Janne

--
Janne Hietamäki
Cemron Ltd
http://www.cemron.com/



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to