Hello,

I have ModalWindow with a panel as content. 
This Panel contains: 
- form with a required textfield
- ajaxsubmitbutton to submit the form (btnSave)
- ajaxlink to fill the textfield and reprint the form (btnSetValue)

When just clicking the 'btnSetValue', the form is reprinted and the value is
set => no problem

Problem:
- first submit the form with 'btnSave' => the form is reprinted to show the
feedbackmessages
- then click the 'btnSetValue' to reprint the form with wanted value => the
form is reprinted, but the value isn't filled in

It's like the model of the form is messed up after the onError.
Please help me with this one, because I don't know where to start..
Am I doing something wrong or is it a bug?
Kind Regards, Marieke Vandamme

Underneath the code of my Panel:

  public TestPanel1(String id){
        super(id);  
        add(new TestForm("testForm"));
    }

    public class TestForm extends Form<FormBean> {
        public TestForm(String id){
            super(id, new CompoundPropertyModel(new FormBean()));
            add(new RequiredTextField("text"));
            add(new FeedbackPanel("feedback"));
            add(new AjaxButton("btnSave") {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?>
form) {
                    System.out.println("submitting TestPanel1 form");
                }

                @Override
                protected void onError(AjaxRequestTarget target, Form<?>
form) {
                    target.addComponent(form);
                }

            });

            add(new AjaxLink("btnSetValue") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    TestForm.this.getModelObject().setText("blablabla");
                    target.addComponent(TestForm.this);
                }
            });
        }
    }

    public class FormBean implements Serializable {
        private String text;

        /**
         * @return the text
         */
        public String getText() {
            return text;
        }

        /**
         * @param text the text to set
         */
        public void setText(String text) {
            this.text = text;
        }
    }
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-with-panel-Strange-model-behaviour-after-onError-tp3046234p3046234.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to