Hi

I have a AJAX modal window wich contains a form. In the form there a an 
radiochoice that has an ajax formcomponentupdatingbehavior. Now the updating 
behavior are trigered but the model of the radiochoice aren't being updated.

Also on the basepage where you can trigger the modal window, I also have a 
form. Not sure if this should make anything fail?

snip of the code from the panel thats used in the modal window:
        public QuestionSelectorPanel(String id, final IModel selectedQuestion,
                        final ModalWindow modalQuestionPop, final Label label) {
                super(id);
                Form form = new Form("form");
                final RadioChoice questionRadio = new RadioChoice("questions",
                                selectedQuestion, Question.getTypes());
                questionRadio.setOutputMarkupId(true);
                questionRadio.add(new 
AjaxFormComponentUpdatingBehavior("onchange") {
                        protected void onUpdate(AjaxRequestTarget target) {
                                System.out.print("selected value should print 
here!:"
                                                + selectedQuestion.toString());
                                // below are working, label prints out foobar
                                // label.setModelObject("foobar!");
                                target.addComponent(label);
                                modalQuestionPop.close(target);
                        }
                });
                add(form);
                form.add(questionRadio);
        }
snip of the basecode:
                final ModalWindow modalQuestionPop = new ModalWindow(
                                "modalquestionpopup");
                add(modalQuestionPop);
                Label label = new Label("selectedradio", selectedQuestion);
                label.setOutputMarkupId(true);
                modalQuestionPop.setOutputMarkupId(true);
                modalQuestionPop.setTitle("Please select a Question type");
                modalQuestionPop.setContent(new 
QuestionSelectorPanel(modalQuestionPop
                                .getContentId(), selectedQuestion, 
modalQuestionPop, label));
                Form form = new Form("form");

                AjaxSubmitButton addQuestion = new 
AjaxSubmitButton("addQuestion", form) {

                        protected void onSubmit(wicket.ajax.AjaxRequestTarget 
arg0,
                                        Form arg1) {
                                modalQuestionPop.show(arg0);
                        };

                };
                form.add(addQuestion);
                add(form);
                add(label);



regards Nino

<<winmail.dat>>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to