Passing around a component ref. (specifically BreadCrumbBar)

2008-04-29 Thread gumnaam23

I have a specific question and a generic question based on it.

I have several Panels added to my BreadCrumbPanels, these panels themselves
extend the Panel class, and
will contain BreadCrumbPanelLinks , to navigate down the hierarchy.

My question is how do I pass the BreadCrumbBar from a BreadCrumbPanel to the
panels that get added to it ? Of course I can create constructors for these
sub panels to take in a IBreadCrumbModel . But this is not an elegant
solution, as I have to pass the BreadCrumbBar to each possible constructor
of the Panel.

The BreadCrumbBar is created in my BasePage, from which all my pages
inherit. So I tried doing something like
 ((BasePage)getPage()).getBreadCrumbBar(), in the sub panels, but it turns
out, that a component does not get a Page associated , to it, at
Construction time.

So what is the best way for a Page, to pass around certain components it
initializes, to child panels , without having to have a constructor for the
Panel that takes in those components ?

I already use spring along with Wicket, so I was thinking of making certain
Components, in to Spring Beans with a Custom scope, say a Page scope. i.e.
the component gets initialized during the Page's construction and can then
be injected to subsequent Components created by the Page's construction.

Any thoughts ? 
-- 
View this message in context: 
http://www.nabble.com/Passing-around-a-component-ref.-%28specifically-BreadCrumbBar%29-tp16957263p16957263.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]



Re: Passing around a component ref. (specifically BreadCrumbBar)

2008-04-29 Thread Johan Compagner
Access them only in onBeforeRender or whwn you need them in an call
back method (onsubmit/onclick)

On 4/29/08, gumnaam23 [EMAIL PROTECTED] wrote:

 I have a specific question and a generic question based on it.

 I have several Panels added to my BreadCrumbPanels, these panels themselves
 extend the Panel class, and
 will contain BreadCrumbPanelLinks , to navigate down the hierarchy.

 My question is how do I pass the BreadCrumbBar from a BreadCrumbPanel to the
 panels that get added to it ? Of course I can create constructors for these
 sub panels to take in a IBreadCrumbModel . But this is not an elegant
 solution, as I have to pass the BreadCrumbBar to each possible constructor
 of the Panel.

 The BreadCrumbBar is created in my BasePage, from which all my pages
 inherit. So I tried doing something like
  ((BasePage)getPage()).getBreadCrumbBar(), in the sub panels, but it turns
 out, that a component does not get a Page associated , to it, at
 Construction time.

 So what is the best way for a Page, to pass around certain components it
 initializes, to child panels , without having to have a constructor for the
 Panel that takes in those components ?

 I already use spring along with Wicket, so I was thinking of making certain
 Components, in to Spring Beans with a Custom scope, say a Page scope. i.e.
 the component gets initialized during the Page's construction and can then
 be injected to subsequent Components created by the Page's construction.

 Any thoughts ?
 --
 View this message in context:
 http://www.nabble.com/Passing-around-a-component-ref.-%28specifically-BreadCrumbBar%29-tp16957263p16957263.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]