Thanks.  So is this the way we should build all components that could be
extended?  If so, how about adding an initialisation hook to avoid this
problem and the need to call super.onBeforeRender() (which I forgot recently
and took me a while to find)... and also to give it a more intuitive name
like initialise()

John


Martijn Dashorst wrote:
> 
> it is called every time the page renders. Though creating objects
> isn't *that* expensive, imagine recreating all your components with
> every request for every user, discarding all the components you
> already created one request earlier.
> 
> Martijn
> 
> On 4/26/08, John Patterson <[EMAIL PROTECTED]> wrote:
>>
>>  Cool. I can see that you now and the links in onBeforeRender().  So is
>> this
>>  the recommended approach for creating extendible components?  What are
>> the
>>  reasons to not to add all child components in this method?
>>
>>
>>
>>  igor.vaynberg wrote:
>>  >
>>  > fixed in trunk for 1.4, i will fix in 1.3.x later today when i can get
>>  > to my desktop.
>>  >
>>  > https://issues.apache.org/jira/browse/WICKET-1548
>>  >
>>  > -igor
>>  >
>>  >
>>  > On Thu, Apr 17, 2008 at 3:54 AM, Maurice Marrink <[EMAIL PROTECTED]>
>>  > wrote:
>>  >> PaginNavigation is not setup properly for extending, we are aware of
>>  >>  this and probably will fix it in wicket 1.5. in the meantime you
>> could
>>  >>  try and copy paste the classes into your own project and then modify
>>  >>  them.
>>  >>
>>  >>  Maurice
>>  >>
>>  >>
>>  >>
>>  >>  On Thu, Apr 17, 2008 at 12:14 PM, John Patterson <[EMAIL PROTECTED]>
>>  >> wrote:
>>  >>  >
>>  >>  >
>>  >>  >
>>  >>  >  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]
>>  >>  >
>>  >>  >
>>  >>
>>  >> 
>> ---------------------------------------------------------------------
>>  >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  >>  For additional commands, e-mail: [EMAIL PROTECTED]
>>  >>
>>  >>
>>  >
>>  > ---------------------------------------------------------------------
>>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  > For additional commands, e-mail: [EMAIL PROTECTED]
>>  >
>>  >
>>  >
>>
>>
>> --
>>  View this message in context:
>> http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16910691.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]
>>
>>
> 
> 
> -- 
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.3 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Alternative-method-to-initialise-page-tp16742636p16910806.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