setMarkupId(true) is used to ensure there is a placeholder generated in the HTML where the addition of the <div> (or whatever) will take place.
You don't set this typically on the form itself, but on a placeholder inside the form that you probably replace with a MarkupContainer of some kind with the same name that contained the new form elements that you wanted to inject. On Thu, Feb 11, 2010 at 9:56 AM, wic...@geofflancaster.com <wic...@geofflancaster.com> wrote: > 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org