Sorry, you are right. Under wicket 1.5 works calling replaceWith on old content. In your code should be something like :

moduleContentPanel = questionnaireContentPanel.replaceWith(moduleContentPanel);
target.addComponent(moduleContentPanel);


I didn't tested it with 1.4.x version.



I tried your solution Andrea :
- just one modal window :s
             modalWindow = new ModalWindowE4N("modalQuestionnaire", "");
             questionnaireContentPanel = new
QuestionnaireContentPanel(modalWindow.getContentId(), this);
             modalWindow.setContent(questionnaireContentPanel);
             modalWindow.setInitialWidth(800);
             add(modalWindow);

- after submit, substitute window content with ModuleContentPanel :
                 membreCourant =
serviceMembre.enregistrerReponses(membreCourant, questionnaireCourant);
                 SessionE4N.get().setMembre(membreCourant);
                 //qPage.getModalWindow().close(target);
                 ModuleContentPanel moduleContentPanel = new
ModuleContentPanel(qPage.getModalWindow().getContentId());
                 moduleContentPanel.initialiserModule(questionnaireCourant);
                 qPage.getModalWindow().setTitle("Module
"+questionnaireCourant.getTitre());
                 qPage.getModalWindow().setContent(moduleContentPanel);

                 target.addComponent(qPage.getModalWindow());
                 //qPage.getModalWindow().show(target);

but modal window is not re-render, so it content is not changed...
maybe target.addComponent() is not sufficient?

so I tried also with qPage.getModalWindow().close before changes and
qPage.getModalWindow().show() after changes (with or without
target.addComponent) : in these cases, we can see modal window change a
second and then render with first content...

what am I doing wrong?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to