I don't quite understand the problem... some code might help. But why can't
you do something like the following:

tabs.add(new AbstractTab(item.getModel()) {
     public Panel getPanel(String panelId) {
         return new AlbumPanel(panelId, );// can be item.getModelObject() or
something
     }
}); 

The above assumes your inside some sort of Wicket Repeater (I assumed this
as you mentioned it was dynamic). Like I said, some more code might help.

nimmy wrote:
> 
> Hi all,
> 
> I'm having a bit of confusion with dynamic tabs and would appreciate your
> help.
> 
> My page has a LDM model. The model wraps an AlbumGroup object, which has a
> list of Album objects.
> 
> I'm creating a tab for each Album object by extending AbstractTab. I'm
> passing in a Model<Album> as a constructor to the tab. This model is used
> to set the title of the tab and should also be used to populate the
> contents of the tab panel.
> 
> How can I pass the Model<Album> to the tab Panel?
> 
> I don't think I can hold the model as an instance variable in the Tab
> until the getPanel() method is called as detach will never be called on
> the LDM.
> 
> I cannot simply implement the IDetachable interface because AbstractTab is
> not a component and detach will not be called on it.
> 
> Am I overthinking the LDM?
> 
> Cheers,
> Nim
> 
> 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3251937.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to