Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 866CDEEAE for ; Tue, 22 Jan 2013 01:36:17 +0000 (UTC) Received: (qmail 32129 invoked by uid 500); 22 Jan 2013 01:36:15 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 32081 invoked by uid 500); 22 Jan 2013 01:36:15 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 32042 invoked by uid 99); 22 Jan 2013 01:36:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 01:36:15 +0000 X-ASF-Spam-Status: No, hits=-3.9 required=5.0 tests=DATE_IN_PAST_03_06,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ozizka@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 01:36:09 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0M1Zlmi020123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Jan 2013 20:35:48 -0500 Received: from [10.36.6.211] (vpn1-6-211.ams2.redhat.com [10.36.6.211]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0M1ZkxS021101 for ; Mon, 21 Jan 2013 20:35:47 -0500 Message-ID: <50FDB09E.1010808@redhat.com> Date: Mon, 21 Jan 2013 22:18:22 +0100 From: Ondrej Zizka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: users@wicket.apache.org Subject: Feedback in AJAX requests //Re: How to pass model changes to parent components? onModelChanged() not working References: <50FD7B3B.9020608@redhat.com> In-Reply-To: <50FD7B3B.9020608@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Virus-Checked: Checked by ClamAV on apache.org Solved - it was wrong validator which never passed, so onModelChanged() was never called. Now I have related problem: FeedbackPanel shows the error when a form is submitted, but not on AJAX. It has setOutputMarkupId( true ); It is added to AjaxRequestTarget. What should I check? Thanks, Ondra On 01/21/2013 06:30 PM, Ondrej Zizka wrote: > Hi all, > > I have a component containing a form with many TextFields. > The way it should work is that when changed, the value should be > persisted immediately (no Save button, all through AJAX). > > The AJAX calls work fine, the value gets to the model. > > The code to save the model (and the entity contained) is in the parent > component. > I thought I would override onModelChanged() to propagate the changes > from the components to the parent. > But onModelChanged() is not called. > > Parent has its own model as class member field. > The subcomponents use this: > > ReleaseTraitRowPanel( String id, IModel relModel, ... ) { > ... > PropertyModel traitModel = new PropertyModel( > relModel.getObject().getTraits(), prop); > > EditableLink4 link = new EditableLink4("link", traitModel){ > // Pass the change notification to upper level. TODO: Does > Wicket do this automatically? > @Override protected void onModelChanged() { > ReleaseTraitRowPanel.this.onModelChanged(); > } > }; > ... > > } > > How should it be done? > Should I pass the onModelChanged() at all? Or does wicket have some > way to notify the other model of changes? > > Related - is CompoundPropertyModel only for forms, or can I use it > with any component? I could use it here - `prop` is the same as id. > > Thanks, > Ondra > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org > For additional commands, e-mail: users-help@wicket.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional commands, e-mail: users-help@wicket.apache.org