You need to call setOutputMarkupId( true ); on the object you're adding to
the AjaxTarget.

ie: If your Feedback panel has the output markup id set to true (you can
see it in the HTML as <... id="someWicketGeneratedId" ... \> and you add
the parent of that Feedback panel ot the target you will get an error.

~ Thank you,
   Paul Bors
On Mon, Jan 21, 2013 at 4:18 PM, Ondrej Zizka <ozi...@redhat.com> wrote:

> 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<IHasTraits> relModel, ... ) {
>>         ...
>>         PropertyModel<String> 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<users-unsubscr...@wicket.apache.org>
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org>
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to