John Patterson wrote:
> 
> Hi,
> 
> I am extending the PagingNavigatation and need to access some member
> variables to create my page links.  Because these links are created in
> PagingNavigatation's constructor me subclasses newPagingNavigationLink()
> method is called before my subclasses member variables are initialised.  I
> realised that this situation must occur quite often when extending any
> class that allows subclasses to provide or override any components.
> 
> Does anyone have a nice workaround?
> 
> It seems to me that creating the pages component tree in some kind of
> initialisation step would make classes easier to extend.  Or is there
> already a method that should be used to do this?
> 
> Thanks,
> 
> John
> 

Just to be a bit clearer

class MySubclass extends WicketBaseclass
{
    MyDomainObject _parameter;
    MySubclass(String id, MyDomainObject parameter)
    {
        super(id);
        _parameter = parameter;
    }

    @Override
    protected Component overrideToCreateCustomComponent()
    {
        return new MyCustomisedCompopnent(_parameter.getSomething());
    }
}

So _parameter will always be null when overrideToCreateCustomComponent() is
called from the base class
-- 
View this message in context: 
http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16742891.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to