Thanks. That did it.
On 7/13/05, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Hmm.. Do you want to edit the entire conference bean, or just the
> company property?
>
> I presume you want to edit the entire conference.
> Something like this should be working.
>
> public class Company {
> private String name;
> // setters and getters
> }
>
> public Class Conference {
> private String stringProperty;
> private Company company;
>
> // setters and getters
> }
>
> public class CreateNewConference extends MyCustomPage {
> public CreateNewConference() {
> FeedbackPanel feedback = new FeedbackPanel("feedback");
> add(feedback);
> User user = getUserSession().getUser();
> Conference conf = new Conference();
> add(new CreateNewConferenceForm("createNewConferenceForm",
> feedback, conf));
> }
>
> class CreateNewConferenceForm extends Form {
> public CreateNewConferenceForm(String id, IFeedback fb,
> Conference conf) {
> super(id, model, fb);
> BoundCompoundPropertyModel model =
> new BoundCompoundPropertyModel(conf);
> add (model.bind(new RequiredTextField("stringProperty",
> "stringProperty"));
> add (model.bind(new RequiredTextField("company_name",
> "company.name");
>
> }
> }
>
> where your markup whould look like this
> <form wicket:id="createNewConferenceForm">
> Name - <input wicket:id="stringProperty"><br/>
> Company Name - <input wicket:id="company_name"><br/>
> </form>
>
> Nick Heudecker wrote:
> > Okay, then I'm confused. Let's say I have the following object:
> >
> > public class Conference {
> > //.. simple properties omitted
> > private Company company;
> > //.. getters and setters
> > }
> >
> > And I want to use the Conference as a model object for a Form. I have:
> >
> > public class CreateNewConference extends MyCustomPage {
> > public CreateNewConference() {
> > FeedbackPanel feedback = new FeedbackPanel("feedback");
> > add();
> > User user = getUserSession().getUser();
> > add(new CfeedbackreateNewConferenceForm("createNewConferenceForm",
> > feedback, user.getCompany()));
> > }
> >
> > private class CreateNewConferenceForm extends Form {
> >
> > public CreateNewConferenceForm(String name, FeedbackPanel
> > feedback, Company c) {
> > super(name, new CompoundPropertyModel(new Conference(c)),
> > feedback);
> > add(new RequiredTextField("name"));
> > }
> >
> > }
> > }
> >
> > Trying that gives me a blank page when I click on the link. If my
> > code looks like I have no idea what I'm doing, the code looks correct.
> > :)
> >
> >
> > On 7/13/05, Matej Knopp <[EMAIL PROTECTED]> wrote:
> >
> >>Hi.
> >>
> >>You can't access the nested properties directly from html as far as I
> >>know. For things like this you need to use the BoundCompoundPropertyModel.
> >>See http://wicket.sourceforge.net/wiki/index.php/Models
> >>
> >>-Matej
> >>
> >>Nick Heudecker wrote:
> >>
> >>>Hi,
> >>>
> >>>For the first large form I'm building, I have a Conference object, and
> >>>Conference has a number of object associations, the most important
> >>>being Company. Since I get the Company from the User when they log
> >>>in, I want to initialize the Company id for the Conference object.
> >>>How can I go about doing that in Wicket?
> >>>
> >>>Let me explain it in steps:
> >>>1) User logs in
> >>>2) User clicks "create new conference"
> >>>3) CreateNewConference page is called, adding a new
> >>>CreateNewConferenceForm to the page. The Form uses a Conference object
> >>>as the model. I need to initialize the Conference object with a few
> >>>values and get those values back after the user has filled in the rest
> >>>of the form.
> >>>
> >>>Make sense?
> >>>
> >>>Also, how do I reference nested objects in the HTML?
> >>>
> >>>Thanks for any help.
> >>>
> >>>
> >>>-------------------------------------------------------
> >>>This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> >>>happening
> >>>July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> >>>core and dual graphics technology at this free one hour event hosted by HP,
> >>>AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
> >>>_______________________________________________
> >>>Wicket-user mailing list
> >>>[email protected]
> >>>https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>>
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> >>July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> >>core and dual graphics technology at this free one hour event hosted by HP,
> >>AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
> >>_______________________________________________
> >>Wicket-user mailing list
> >>[email protected]
> >>https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> > July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> > core and dual graphics technology at this free one hour event hosted by HP,
> > AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user