If you want to use a CompoundPropertyModel you can do something like the following in the constructor of the component:
setModel(new CompoundPropertyModel(...)); // where ... is either your POJO or another model add(new Label("userModel.userName")); Leave the html unchanged. Because you did not set a model on the label, the label will search in its parent(s) for a CompoundPropertyModel. Regards, Erik. >> -----Ursprüngliche Nachricht----- >> Von: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] Im Auftrag >> von [EMAIL PROTECTED] >> Gesendet: Freitag, 10. November 2006 11:13 >> An: wicket-user@lists.sourceforge.net >> Betreff: [Wicket-user] Wizard StaticContentStep and >> CompoundPropertyModel >> >> Hello all ! >> >> I would like to add a CompoundPropertyModel as wizard static >> page. I have done so far: >> >> public class StepX extends StaticContentStep { >> >> /** >> * Constructor. >> * >> * @param userModel >> */ >> public StepX(UserModel userModel) >> { >> super(true); >> >> IModel model = new Model(userModel); >> setTitleModel(new ResourceModel("confirmation.title")); >> setSummaryModel(new >> StringResourceModel("confirmation.summary", this, model)); >> >> setContentModel(new CompoundPropertyModel(userModel)); >> >> } >> } >> >> My UserModel look like this: >> >> public class UserModel implements Serializable { >> >> private String userName; >> >> public final String getUserName() { >> return this.userName; >> } >> >> public final void setUserName(String userName) { >> this.userName = userName; >> } >> >> } >> >> >> How can I simply output the username property collected in a >> previous step? I tried the following code: >> >> <wicket:panel> >> <table> >> <tr> >> <td> >> <span >> wicket:id="userModel.userName">[userName]</span> >> </td> >> </tr> >> </table> >> </wicket:panel> >> >> >> ... but wicket gives me the following error message: >> >> unable to find component with id 'userModel.userName'. This >> means that you declared wicket:id=userModel.userName in your >> markup, but that you either did not add the component to your >> page at all, or that the hierarchy does not match. >> >> Has anyone a solution for this? >> >> Thank you very much, >> >> Maciej >> >> -------------------------------------------------------------- >> ----------- >> Using Tomcat but need to do more? Need to support web >> services, security? >> Get stuff done quickly with pre-integrated technology to make >> your job easier Download IBM WebSphere Application Server >> v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057& >> > dat=121642 > >> _______________________________________________ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> >> > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user