Re: Contructor model

2008-06-05 Thread Manuel Corrales
I will try that, thanks! On Thu, Jun 5, 2008 at 11:25 AM, Gwyn Evans <[EMAIL PROTECTED]> wrote: > In which case, maybe something along the lines of... > > MyPage() { > displayedName = ""; > setModel(new CompoundPropertyModel(new Customer(displayedName)); > Form form = new Form() { >void on

Re: Contructor model

2008-06-05 Thread Gwyn Evans
In which case, maybe something along the lines of... MyPage() { displayedName = ""; setModel(new CompoundPropertyModel(new Customer(displayedName)); Form form = new Form() { void onSubmit() { Customer customer = (Customer)getModelObject(); if (!displayedName.equals(customer.g

Re: Contructor model

2008-06-05 Thread Manuel Corrales
Half way there :) public class MyPage extends WebPage { public MyPage(String name) { setModel(new Model(new Customer(name)); that what i want, but instead of having name as a parameter on the page constructor, i would like to have it from the same form the other Customer data is being filled.

Re: Contructor model

2008-06-05 Thread Gwyn Evans
Are you looking for something like: public class MyPage extends WebPage { public MyPage(String name) { setModel(new Model(new Customer(name)); ... /Gwyn On Thu, Jun 5, 2008 at 2:22 PM, Manuel Corrales <[EMAIL PROTECTED]> wrote: > Hi, i will rephrase. I have a class Customer on my domai

Re: Contructor model

2008-06-05 Thread Manuel Corrales
Hi, i will rephrase. I have a class Customer on my domain, and Customer do not have a default constructor. Lets assume Customer have a constructor with a String: public class Customer { Customer(String name) { ... } } It is possible to create a wicket model, to create a new instance

Re: Contructor model

2008-06-04 Thread Maurice Marrink
What do you mean? If your page accepts a certain model in its constructor you can do with it whatever you want. Any page (with or without empty constructor) can be created from within another page. Although typically you will do this on a link click or form submit. Just do setResponsePage(new MyPag

Contructor model

2008-06-04 Thread Manuel Corrales
Hi, let assume i have a class with no empty constructors (at least no publics). And i want to use a wicket page to instantiate this class. It is possible to create a model for this, so i dont have to use another object or add setters. I dont know if i made myself clear. Please feel free to ask. Th