> 1) working with many attributes of an object > we have some pages where we access many attributes of an object, say we want > to show all 20 attributes of a person and all 10 attributes of > person.getAddress(); > in the PersonPage.java i would have to add 30 label (or input) components, > 30 lines with nearly identical java code: add(new Label("firstName", > person.getName() ); > isn't it tedious to always keep PersonDetails.java and PersonDetails.html > files in sync? in jsf/jsp the changes are only in the jsp/xhtml
There are few options that come into my mind: 1. add(new Label(CONSTANT_FIRST_NAME, person.getName() ); // Now you can re-use your constant from WicketTests. 2. add(new Label(CONSTANT_FIRST_NAME, new PropertyModel(person, Person.NAME_CONSTANT) ); // Now you can re-use your Entity's NAME -constant from JPA/ORM/Hibernate queries. 3. use CompoundPropertyModels. Yes. You will have to sync the names in html and in Java. Maybe someone will develop a nice plugin that automates this in the future: http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels http://cwiki.apache.org/WICKET/more-on-models.html > 2) page composition You can treat Title just as a Label. See <wicket:head> tag and Wicket modularity: http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html http://www.javalobby.org/java/forums/t60926.html http://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html > 3) preview functionality > is this right: as soon as we use page composition and components, the > preview feature is gone; how do you experienced wicket users handle this? is > it usable in a prototype phase - before the html prototype is decomposed > into composition parts and components? The runtime page hierarchy is ofcourse visible only at runtime, but you can preview each panel separately ofcourse (if it makes sense). > is there a resource on the web that helps with the task of migrating from > jsf to wicket? I would save the html files using a browser (if the html markup is not available separately) and just pick up from there, starting to add wicket:id's to the components of the page, one-by-one (in development & debug mode it is quite fast as you do not need to restart the jetty server after saved&compiled change). my 2 cents ;) ** Martin --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org