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()
Steve Swinsburg-2 wrote:
>
> 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
> constructed, is this possible/recommended?
>
>
> cheers,
> Steve
>
>
>
>
>
>
> On 29 Sep 2008, at 12:58, Thies Edeling wrote:
>
>> 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 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.getCurrentUserId();
>>>>
>>>> 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 that are defined in the parent class MyProfile.java
>>>>
>>>>
>>>>
>>>> cheers,
>>>> Steve
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> -----
>>> Michael Sparer
>>> http://talk-on-tech.blogspot.com
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
>
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context:
http://www.nabble.com/wicket-panels-and-parent-class-tp19722417p19722714.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]