show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
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,

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Sven Meier
Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/show-modal-window-without-clicking-on-ajaxLink-tp3703364p3703409.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscr

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Andrea Del Bene
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

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
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...

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
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

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Andrea Del Bene
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(modalQuestionnaireMod

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Mathilde Pellerin
I tried your solution Andrea : - just one modal window : modalWindow = new ModalWindowE4N("modalQuestionnaire", ""); questionnaireContentPanel = new QuestionnaireContentPanel(modalWindow.getContentId(), this); modalWindow.setContent(questionnaireContentPanel);

Re: show modal window without clicking on ajaxLink

2011-07-29 Thread Andrea Del Bene
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

Re: show modal window without clicking on ajaxLink

2011-08-01 Thread Mathilde Pellerin
I use Wicket 1.4.17. I tried with replaceWith like this : //affichage du module interactif String idContent = qPage.getModalWindow().getContentId(); ModuleContentPanel moduleContentPanel = new ModuleContentPanel(idContent); moduleConte

Re: show modal window without clicking on ajaxLink

2011-08-01 Thread Andrea Del Bene
Hi, I've adapted (and tested) my solution to wicket 1.4.17. It's slightly different from 1.5 because you should pass target.addComponent just moduleContentPanel and not the whole window. The code of my solution is this: //modal window constructor add(new AjaxLink("btn") { @Ov

Re: show modal window without clicking on ajaxLink

2011-08-01 Thread Mathilde Pellerin
Thank you very much Andrea. Now unit tests are OK and it works well when I test it manually. 2011/8/1 Mathilde Pellerin > I use Wicket 1.4.17. > I tried with replaceWith like this : > //affichage du module interactif > String idContent = qPage.getModalWindow().g