juan.pablo.coen.mitrani wrote:
> 
> Hi,
> I've noticed that recorderComponent initialization has been moved from
> Palette constructor to private initFactories() method which is called by
> onBeforeRender() method.
> 
> I was trying to add an Ajax behavior to a new Palette like this:
>    Palette palette = new Palette( ... );
>    AjaxFormComponentUpdatingBehavior ajaxBehavior =
>    new AjaxFormComponentUpdatingBehavior("onchange") { ... };
> 
>    palette.getRecorderComponent().add(ajaxBehavior);
>    add(palette);
> 
> This is obviously giving me a NullPointerException, as recorderComponent
> is null at the time I'm trying to get it.
> 
> Is there a new way to add a behavior to the Palette?
> 
> Thanks,
> Juan Pablo
> 

Hi Juan Pablo,by now, you posibly don't need this, but...
A possible solution to this is:

Palette palette=new Palette(....){
                        @Override
                        protected void onBeforeRender() {                       
                                super.onBeforeRender();
                                getRecorderComponent().add(
new AjaxFormComponentUpdatingBehavior(...){});

so, super.onBeforeRender(); creates the recorderComponent and the internal
ids array.
I'm using it this way, and so far,it's working fine

Exequiel Aguirre
-- 
View this message in context: 
http://www.nabble.com/Palette-and-recorderComponent-initialization-%28Wicket-1.3.1%29-tp15871741p22587661.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to