Ok. I am sorry to bother you. I add the behavior at before render time: protected void onBeforeRender() {
super.onBeforeRender(); final Recorder recorder=palette.getRecorderComponent(); palette.getRecorderComponent().add(new AjaxFormComponentUpdatingBehavior( "onchange") { @SuppressWarnings("unchecked") @Override protected void onUpdate(AjaxRequestTarget target) { .... } }); } and I has been working right to me. But, if you would like to extend Pallete and overwrite newRecorderCompoent + adding the behavior, It seemed to be fine. On Fri, Sep 25, 2009 at 12:27 PM, Tim Hughes <thug...@troglobyte.com> wrote: > OK, I changed the code as follows, and I'm getting a null on the > patentsPalette.getRecorderComponent() method. > > Palette<Category> patentsPalette = new > Palette<Category>("categoryPalette", selected, allCategories, renderer, 10, > false); > > final Recorder recorder = patentsPalette.getRecorderComponent(); > recorder.add( new AjaxFormComponentUpdatingBehavior( "onchange" ) { > @Override > protected void onUpdate ( AjaxRequestTarget ajaxRequestTarget ) > { > > > selectedDocumentModel.getObject().addCategory((Category)recorder.getSelectedChoices().next()); > } > }); > > All of this takes place in the constructor for my form. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Fernando Wermus. www.linkedin.com/in/fernandowermus