well one (as said ugly ;-)) way that comes to my mind is to ask if component.getParent().getParent() instanceof Page (that should also work if you use nested subpages).
regards, Michael you could check if it's a transparentwebmarkupcontainer with instanceof. Ned Collyer wrote: > > I basically want the components Model. > > It's legitimate for it to be null. So, if I can see which component is a > page, then i can easily call the "getPage().getModel()" > > Of course if it's TransparentWebMarkupContainer then getModel returns null > even if the page has a model set. > > It appears to work with panels, just not page. > > Are there other conditions that will cause the component to come through > as > TransparentWebMarkupContainer? How can I determine it's a page :). Ugly > hacks are not something i enjoy/advocate using. > > On Tue, Apr 29, 2008 at 6:56 PM, Michael Sparer <[EMAIL PROTECTED]> > wrote: > >> >> yepp, then the TransparentWebMarkupContainer gets passed in. And you're >> right, it's gonna be a filthy hack if you try to find out if its a Page. >> Unfortunately I've got no further suggestions but it'd be interesting to >> know why you want to distinguish between pages and other components >> anyway >> ... >> >> regards, >> Michael >> >> > > ----- Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/loadStringResource%28Component-component%2C-String-key%29---correct-method-to-check-if-the-component-IS-a-Page--tp16930303p16957722.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]