On 10/3/07, Martin-2 <[EMAIL PROTECTED]> wrote: > > Hi, Hi, thanks for the quick reply.
> if I understand correctly, the page variable and the panel model should > always point to the same thing. Right. > I suggest you give your page a model with > currentRecommendation as model object. Then construct your panel with the > same model instance as the page (or wrap it with an IChainingModel) and get > rid of the page wide variable. I can't do that because my page is rather complex and it deals with at least two different kinds of objects. That's why I choose to have the currentRecommendation page variable instead, and a panel inside the related form that deals with the variable through the CompoundPropertyModel. > The form's onSubmit() would be like: > > selectedValue = obtainSelectedValue(); > getPage().getModel().setObject(selectedValue); > setResponsePage(getPage()); > > so setting the page's model object to the choice the user selected, and only > setting it if validation succeeds. I don't think this could solve my problem because: 1) I don't want the whole page to be refreshed or reloaded but only the panel that deals with currentRecommendation; 2) more important, I don't want the panel to be refreshed only if validation succeeds; I want it to always reflect user's selection from the ListChoice, i.e. the currentRecommendation which is the model object of the panel. The problem here is that, when form validation fails, the panel (which is contained in the form) stops responding to user's selections on the ListChoice as if its model loses the pointer to currentRecommendation. I hope I've been clear enough, 'cause it's not so easy to explain... Thanks a lot for your help! Fabio Fioretti - WindoM --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
