I'm trying to add form components to a form using ajax. i've set
"setMarkupId(true);" on the form but when I run it, i get an error saying
"cannot update component that does not have setOutputMarkupId property set
to true. Component: [MarkupContainer [Component id = realTimeForm..."

So basically when someone moves 1 or more selections from the available to
the selected side of the palette, i want it to add another palette to the
form.

Code Snippet:

List valueList = new ArrayList(); // this actually has values 
IChoiceRenderer renderer = new ChoiceRenderer();
Palette palette = new Palette("palette", new Model(new ArrayList()), new
Model(valueList), renderer, 5, false){
        @Override
        protected Recorder newRecorderComponent() {
                Recorder rec = super.newRecorderComponent();
                rec.setRequired(true);
                rec.add(new AjaxFormComponentUpdatingBehavior("onchange") {
                        @Override
                        protected void onUpdate(AjaxRequestTarget target) {
                            Palette newPalette = new
Palette("newPalette",new Model(new ArrayList()),new Model(new
ArrayList()),renderer,5,false);
                            target.addComponent(newPalette);
                        }
                });
                return rec;
        }
};

public Constructor(){
Form form = new Form("realTimeForm");
form.setOutputMarkupId(true);  //enable ajax on the form
form.add(palette);
add(form);
}

--------------------------------------------------------------------
myhosting.com - Premium Microsoft® Windows® and Linux web and application
hosting - http://link.myhosting.com/myhosting



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to