Hi Mathilde,
why not simply substitute modal window content instead of reloading page
and creating a brand new modal window?
Your code doesn't work because setResponsePage create a new instance of
QuestionnairesPage different from the one referenced by qPage variable.
Hi all,
I have a page with an AjaxLink which shows a modal window. This modal window
contains a form and when we submit the form, modal window disappear, my page
is reloaded and a second ajaxLink is created. When we click on this second
ajaxLink, another modal window appears.
This part works well, but now, I want that the second modal window appears
after submitting the first form (and so without clicking on the second ajax
Link).
I try this on my form onSubmit method :
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
//[...] some form processing
membreCourant = serviceMembre.enregistrerReponses(membreCourant,
questionnaireCourant);
SessionE4N.get().setMembre(membreCourant);
//reload the page, so first modal window disappears and second ajax link
is created
setResponsePage(QuestionnairesPage.class, new PageParameters("p=3"));
//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);
}
qPage is initialize on modal window constructor:
public QuestionnaireContentPanel(String id, QuestionnairesPage
questionnairesPage){
super(id);
this.qPage = questionnairesPage;
Form<Void> qForm = creationFormulaireQuestionnaire();
add(qForm);
}
but it doesn't work : second modal window is not shown.
What am I doing wrong?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org