add it!

David Liebeherr wrote:

Hehe, what is this supposed to mean? :-)
"Add it to wiki" or "You damn fool there is already a Tutorial on wiki for it so: RTFM!"? :-)

Cu,
Dave

Jonathan Locke wrote:


wikiwiki!

David Liebeherr wrote:

I think you missuderstood me or i was not able to explain it clear enough. I wanted to use the same Form/Page for Editing yet existing Persons (which are in the People List) and edit new Persons (which has to be added to the People-List). Your solution does only work for editing new Persons but not for yet existing ones. (Or maybe i just do not understand your solution fully...)
But i found a solution for my Problem, and it goes like this:

On the Page where i show a list (Table) of Persons which are in the People-List i have two links:
1. Edit link which does the Following:
onClick() {
setRepsonsePage(new PersonEdit(person, personList)); //person is a reference to a existing Person Object
}
2. New Link which does the Following:
onClick() {
   setResponsePage(new PersonEdit(new Person(), personList));
}

And on the PersonEdit Page it goes like this:
onSubmit() {
   if (!this.personList.contains(this.person)) {
      this.personList.add(this.person);
   }
}

This works very well and i think it's clean and nice.
I think i will put it on the wicket wiki as a small tutorial, what do you think?

Anyway thank you for your reply!

Dave

Eelco Hillenius wrote:

In your form:

public MyForm(String id, IModel model)
{
 super(id, new CompoundPropertyModel(new Person()));
 ...
}

public void onSubmit()
{
Person newPerson = (Person)getModelObject(); // by now this object is 'filled' using your form components
  getPersonList().add(newPerson);
// now navigate to another page or set a new person to edit like setModel(new CompoundPropertyModel(new Person()))
}

Eelco

David Liebeherr wrote:

I have a Page with a Form to edit an Person object.
The Person object is always part of a People-List.

The Form uses a CompoundPropertyModel.
It works fine when i edit a given Person object.

So my question is now:
How can i implement it that the CompoudPropertyModel adds a new Person object to the People-List when i use it for editinig a new Person?

Thanks,
Dave


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user








-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user







-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to