so you have
Panel
SubPanel1
SubPanel2
all three of them have a LoadableModel
and the 2 subs depend on the Parent panel?
But does the parent panel itself do anything with the data?
do you call getModelObject on it? or getModel().getObject() ?
if not that you dont need to give that panel the loadable model
If you say that the 2 subs need models and those depend on the parent model
then you could give the SubPanels a model like this:
public class MySpecialSubPanelModel
{
MySpecialSubPanelModel(LoadableModel parentModel) {}
getObject()
{
Object object = parentmodel.getObect()
/// do something with that object to create another object??
return otherObject;
}
}
johan
On Tue, May 20, 2008 at 6:08 PM, msmall <[EMAIL PROTECTED]> wrote:
>
> I have a parent panel that has several sub panels that are indirectly
> dependent on their parent's model. By that I mean the parent panel's model
> needs to load data that is independent of the data loaded in the sub
> panels,
> but the sub panels are dependent on the data loaded by the parent to load
> their specific data. I think this falls outside of the normal use of
> models
> (LoadableDetachableModels that are separate but dependent on a chain of
> other LoadableDetachableModels), but I thought I'd use the auto-magically
> loading feature to easy the coding.
>
>
> Martijn Dashorst wrote:
> >
> > But why?
> >
> > In any case, you can just call getModelObject() on the panel to get
> > the loaded object. Which is much better from an encapsulation pov.
> >
> > Martijn
> >
> > On Tue, May 20, 2008 at 5:55 PM, msmall <[EMAIL PROTECTED]>
> wrote:
> >>
> >> Yes. I'm just invoking the load method directly in my overriding
> >> onBeforeRender method of the panel. Works just fine ... I just expected
> >> the
> >> component to handle without my manual involvement.
> >>
> >> jwcarman wrote:
> >>>
> >>> Do you *need* it to load?
> >>>
> >>> On Tue, May 20, 2008 at 11:45 AM, msmall <[EMAIL PROTECTED]>
> >>> wrote:
> >>>>
> >>>> And thanks for the help.
> >>>>
> >>>>
> >>>> jwcarman wrote:
> >>>>>
> >>>>> If it doesn't need the object (nothing's using it), then why would it
> >>>>> call load()?
> >>>>>
> >>>>> On Tue, May 20, 2008 at 11:24 AM, msmall <[EMAIL PROTECTED]>
> >>>>> wrote:
> >>>>>>
> >>>>>> No, I'm just wiring up the panel so it does not have any
> >>>>>> subcomponents
> >>>>>> yet.
> >>>>>> Regardless, I'm confused as to why Panel, as a Component, would not
> >>>>>> handle
> >>>>>> this on its own.
> >>>>>>
> >>>>>>
> >>>>>> jwcarman wrote:
> >>>>>>>
> >>>>>>> Does the panel ever use its model? Do you have any subcomponents
> >>>>>>> that
> >>>>>>> try to access their parent's (the panel's model)?
> >>>>>>>
> >>>>>>> On Tue, May 20, 2008 at 11:19 AM, msmall <
> [EMAIL PROTECTED]>
> >>>>>>> wrote:
> >>>>>>>>
> >>>>>>>> I have a panel that has a LoadableDetachableModel as its model
> >>>>>>>> (i.e.
> >>>>>>>> I'm
> >>>>>>>> calling this.setModel(new LoadableDetachableModel() { ... }) in
> the
> >>>>>>>> constructor of my panel, but this load method of the model is
> never
> >>>>>>>> invoked.
> >>>>>>>> If I use that model in another component, such as a Label, it
> works
> >>>>>>>> correctly. Do panels not support detachable models?
> >>>>>>>> --
> >>>>>>>> View this message in context:
> >>>>>>>>
> http://www.nabble.com/Panel%27s-LoadableDetachableModel-not-being-loaded-tp17343003p17343003.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]
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> View this message in context:
> >>>>>>
> http://www.nabble.com/Panel%27s-LoadableDetachableModel-not-being-loaded-tp17343003p17343131.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]
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> http://www.nabble.com/Panel%27s-LoadableDetachableModel-not-being-loaded-tp17343003p17343660.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]
> >>>
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Panel%27s-LoadableDetachableModel-not-being-loaded-tp17343003p17343892.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/Panel%27s-LoadableDetachableModel-not-being-loaded-tp17343003p17344191.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]
>
>