Re: wicket panels and parent class

2008-09-30 Thread James Carman
Exactly. The (typed) IModel abstraction approach is the most "wickety" way of doing it. :) On Mon, Sep 29, 2008 at 9:13 PM, Timo Rantalaiho <[EMAIL PROTECTED]> wrote: > On Mon, 29 Sep 2008, James Carman wrote: >> Just be careful. If the object reference in the parent is retrieved >> from a Loada

Re: wicket panels and parent class

2008-09-29 Thread Timo Rantalaiho
On Mon, 29 Sep 2008, Michael Sparer wrote: > possible yes, recommended, no i'd say :-) > > if you need specific values from MyPanel then pass it via constructor, if > you need values/attributes on component (e.g. isVisible) level use > getParent() I think that getParent() is generally a bad idea,

Re: wicket panels and parent class

2008-09-29 Thread Timo Rantalaiho
On Mon, 29 Sep 2008, James Carman wrote: > Just be careful. If the object reference in the parent is retrieved > from a LoadableDetachableModel, then your panel and its parent can get > out of sync. Because of this, it is often better to abstract the access with IModel. Best wishes, Timo -- Ti

Re: wicket panels and parent class

2008-09-29 Thread Phil Grimm
It may not be a "best practice", but if MyInfoPanel does not need to be "reusable" you can make it an inner class of MyProfile. Then userId can be accessed directly. Phil On Mon, Sep 29, 2008 at 6:45 AM, Steve Swinsburg < [EMAIL PROTECTED]> wrote: > Hi all, > I'm a new Wicket user and am develop

Re: wicket panels and parent class

2008-09-29 Thread James Carman
); >>> >>> add(new MyInfoPanel("myInfoPanel")); >>> >>> >>> and in MyInfoPanel.java >>> >>> I need to be able to access userId for example. >>> >>> This is just a basic example, I need to access certain objects in >>> MyInfoPanel.java

Re: wicket panels and parent class

2008-09-29 Thread Steve Swinsburg
ed to be able to access userId for example. This is just a basic example, I need to access certain objects in MyInfoPanel.java that are defined in the parent class MyProfile.java cheers, Steve -- View this message in context: http://www.nabble.com/wicket-panels-and-parent-class-tp19

Re: wicket panels and parent class

2008-09-29 Thread Michael Sparer
gt;>>> >>>> >>>> >>>> cheers, >>>> Steve >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>>

Re: wicket panels and parent class

2008-09-29 Thread jWeekend
gt; and in MyInfoPanel.java > > I need to be able to access userId for example. > > This is just a basic example, I need to access certain objects in > MyInfoPanel.java that are defined in the parent class MyProfile.java > > > > cheers, > Steve > >

Re: wicket panels and parent class

2008-09-29 Thread Steve Swinsburg
I guess I am used to the jsp:include method of including panel type objects since I am originally a JSP developer and then anything in the panel instantly has access to the variables defined in the surrounding parent. I guess I could pass along a HashMap of data to the Panel when its cons

Re: wicket panels and parent class

2008-09-29 Thread Thies Edeling
And then have to cast it to the class of the parent.. which kinda kills the independent component based idea of reusable panels. Why not pass along the userid when constructing? Or fetch it from the session. Michael Sparer wrote: getParent() ? Steve Swinsburg-2 wrote: Hi all, I'm a ne

Re: wicket panels and parent class

2008-09-29 Thread Michael Sparer
st a basic example, I need to access certain objects in > MyInfoPanel.java that are defined in the parent class MyProfile.java > > > > cheers, > Steve > > > > > > > > > > - Michael Sparer http://talk-on-tech.blogspot.com --

wicket panels and parent class

2008-09-29 Thread Steve Swinsburg
Hi all, I'm a new Wicket user and am developing an application making use of Panels. The Panels are working, however I need to access some objects in the panel that are defined in the parent class and am not sure how to do this. e.g. MyProfile.java: String userId = Profile.getCurrentUse