Thanks everyone,

I changed my constructor to accept the object I wanted and passed it in from the parent class. It's working now.

cheers,
Steve

---
Steve Swinsburg
Portal Systems Developer
Centre for e-Science
Lancaster University
Lancaster
LA1 4YT

email: [EMAIL PROTECTED]
phone: +44 (0) 1524 594870







On 29 Sep 2008, at 13:08, jWeekend wrote:


Your Panel is just a Java class, so give it a constructor that takes the required object(s), or provide a setter if that wouldn't be too late (ie if the values are required during the panel's construction). Or, take a look at
CompoundPropeprtyModel (maybe together with ComponentPropertyModel too
depending on your naming conventions).

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk




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











--
View this message in context: 
http://www.nabble.com/wicket-panels-and-parent-class-tp19722417p19722687.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]


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to