If you look at the source code for AjaxEditableLabel you could've seen that it is not suited for CompoundPropertyModel usage. Because the editor requires two components: a label and an input box, which are both created with "label" ,resp. "editor" component identifiers, which both bind to the default model (in your case: none), they will use their component id's to look up their model bindings. This is easily solvable by providing an explicit propertymodel to the AEL.
The following should work: add(new AEL("codProduct", new PropertyModel<String>(getDefaultModel(), "codProduct"))); Martijn On Thu, Jul 15, 2010 at 2:25 PM, Mansour Al Akeel <mansour.alak...@gmail.com> wrote: > so what should I use in this case? > can you give me an example, to update the panel and have ajax fields ? > > > On Thu, Jul 15, 2010 at 3:17 PM, Martin Makundi > <martin.maku...@koodaripalvelut.com> wrote: >> Hi! >> >> I would dis-advice you using compoundpropertymodel. Dropping it will >> make everything more explicit and clear all your problems. Using >> compoundpropertymodel you will get all kinds of surprises.. sometimes, >> and spend lot of extra time resolving. >> >> ** >> Martin >> >> 2010/7/15 Mansour Al Akeel <mansour.alak...@gmail.com>: >>> Hello all, I have been trying to resolve this issue. I have a panel >>> that shows a product info. >>> >>> public class ProductDetails extends Panel { >>> >>> public ProductDetails(String id, final Product product) { >>> super(id); >>> setOutputMarkupId(true); >>> this.setCurrentProduct(product); >>> add(new Label("id")); >>> add(new Label("codProduct")); >>> add(new AjaxLink<String>("save") { >>> �...@override >>> public void onClick(AjaxRequestTarget target) { >>> System.out.println("saving product .... "); >>> } >>> }); >>> } >>> public void setCurrentProduct(Product product) { >>> setDefaultModel(new CompoundPropertyModel<Product>(product)); >>> } >>> } >>> >>> >>> when ever I click a link to update the product panel using ajax link, >>> I get the correct info displayed. However, I need to be able to edit >>> the labels in the panel. So I used : >>> >>> add(new AjaxEditableLabel<String>("codProduct")); >>> >>> I get this: >>> >>> WicketMessage: No get method defined for class: class >>> rentals.entities.Product expression: label >>> >>> In a previous thread, I was advised to use CompoundPropertyModel, and >>> I think it's easier, but why I am getting this ? >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org