Hi all,
thanks for your time and for keeping up this precious users' list.
I have a page with a page-global "currentRecommendation" variable. The
instance of this variable is updated by selecting one of the entries
of a ListChoice; basically, the ListChoice deals with a list of
"recommendations" instances and sets "currentRecommendation" to the
one selected by the user.
When a recommendation is selected, its data are loaded and displayed
in a "recommendationForm" (contained in the same page) defined like
this:
recommendationForm = new Form("recommendationForm");
The form contains a custom recommendationPanel which is linked to the
"currentRecommendation" instance by a CompoundPropertyModel built on
an AbstractReadOnlyModel, just like this:
IModel recommendationModel = new AbstractReadOnlyModel() {
@Override
public Object getObject(Component component) {
return currentRecommendation;
}
};
recommendationPanel = new CustomPanel("recommendationPanel", new
CompoundPropertyModel(recommendationModel));
The problem is that when the form is submitted and validation *fails*,
the CompoundPropertyModel of the "recommendationPanel" seems to
disconnect from the "currentRecommendation" instance, because clicking
on a different entry of the ListChoice mentioned above still refreshes
the form but doesn't update the data contained in it anymore.
In other words, the underlying "currentRecommendation" instance keeps
changing correctly on ListChoice selection change (and the
AbstractReadOnlyModel correctly picks up the selected instance), but
the form (i.e. the panel contained in it) keeps displaying the
instance that failed validation and doesn't show the newly selected
recommendation instance anymore.
The whole thing happens only when form validation fails.
What am I missing?
Thanks a lot for your help,
Fabio Fioretti - WindoM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]