Re: AjaxSubmitLink accessing model object non-existent property

2008-04-09 Thread Tim Squires
OK. It's clicked. I was hoping to have a simple ajaxed submit link without having to create a fake property on the model object. No problem, I can see what I missed. Thanks for your help Igor. Tim you said it yourself: Insure that the component identifier names match the appropriate

Re: AjaxSubmitLink accessing model object non-existent property

2008-04-09 Thread Igor Vaynberg
you can, just give the cpm reference to link as the model. -igor On Wed, Apr 9, 2008 at 1:31 AM, Tim Squires [EMAIL PROTECTED] wrote: OK. It's clicked. I was hoping to have a simple ajaxed submit link without having to create a fake property on the model object. No problem, I can see

Re: AjaxSubmitLink accessing model object non-existent property

2008-04-08 Thread Tim Squires
I have read it - a few times over the last 3 years of using Wicket and even bought the book ;) It says To use a CompoundPropertyModel, simply set one as the model for a container, such as a Form or a Page. Create the contained components with no model of their own. Insure that the component

Re: AjaxSubmitLink accessing model object non-existent property

2008-04-08 Thread Igor Vaynberg
you said it yourself: Insure that the component identifier names match the appropriate property names. what that says is that the model you get is the property of the model object that is in the cpm with the name of component id. so since your links id is foo it will try to pull out the model

AjaxSubmitLink accessing model object non-existent property

2008-04-07 Thread Tim Squires
Hi, When adding an AjaxSubmitLink, the onSubmit method tries to access a property of the model object that does not exists: --- final AjaxSubmitLink confirmLink = new AjaxSubmitLink(confirm) { @Override public void onSubmit(final

Re: AjaxSubmitLink accessing model object non-existent property

2008-04-07 Thread Tim
Thanks Igor but should it not pick-up the model from the Form? There's no constructor that takes a model. Should the AjaxSubmitLink(id, form) constructor be used with the Form that it's being added to? e..g MyForm extends Form { public MyForm(){ add( new AjaxSubmitLink(mylink,this){

Re: AjaxSubmitLink accessing model object non-existent property

2008-04-07 Thread Igor Vaynberg
no, components do not randomly pick up models from their parents. i would suggest reading the models wiki page. -igor On Mon, Apr 7, 2008 at 3:11 PM, Tim [EMAIL PROTECTED] wrote: Thanks Igor but should it not pick-up the model from the Form? There's no constructor that takes a model.