Try to use just one modal window and switch content panels. I.e:

-Create modal window with questionnaireContentPanel as initial content:

modalQuestionnaireModule = new ModalWindowE4N("modalQuestionnaireModule",""); questionnaireContentPanel = new QuestionnaireContentPanel(modalQuestionnaireModule.getContentId(), this);

modalQuestionnaireModule.setContent(questionnaireContentPanel);
modalQuestionnaireModule.setInitialWidth(800);

add(modalQuestionnaireModule);


-Show modal window
....


-After submit substitute window content with ModuleContentPanel:


protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
    //[...] some form processing

    membreCourant = serviceMembre.enregistrerReponses(membreCourant,
questionnaireCourant);
    SessionE4N.get().setMembre(membreCourant);

    //substitute window content
Panel newContent = new ModuleContentPanel(modalQuestionnaireModule.getContentId(), this);
    modalQuestionnaireModule.setContent(newContent);

    //re-render window itself.
    target.addComponent(modalQuestionnaireModule);



Well, I talked too fast.
In fact, with Sven's solution :

                 membreCourant =
serviceMembre.enregistrerReponses(membreCourant, questionnaireCourant);
                 SessionE4N.get().setMembre(membreCourant);
                 //setResponsePage(QuestionnairesPage.class, new
PageParameters("p=3"));

                 qPage.getModalQuestionnaire().close(target);

                 //on affiche le module correspondant au questionnaire qu'on
vient de remplir

qPage.getModuleContentPanel().initialiserModule(questionnaireCourant);
                 qPage.getModalModule().setTitle("Module
"+questionnaireCourant.getTitre());
                 qPage.getModalModule().show(target);

first modal window is closed, but the second is not really shown : in fact,
a modal window empty appears, but it has the first modal window title. (and
second modal window shouldn't be empty thanks to method initialiserModule)
I don't understand what happen, so if you have an idea, let me know...


2011/7/29 Mathilde Pellerin<[email protected]>

Thanks a lot for your answer.
The solution of Sven Meier works well.

Sometimes I wonder why I always try complex solutions instead of simplest
one...





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to