PDA

View Full Version : Calling "Impl" panel from core panel



kleink
04-26-2003, 05:16 PM
I have created a custom panel that allows the user to enter some data multiple times before exiting.

Example: User enters login name and password and selects a check box to enter additional users. When they click the Next button, instead of exiting the panel adds the information to a List.

What I would like to do is also clear the TextFields for the user and also keep a List of the users entered so far.

I could put this in the exiting() method of the PanelImpl, however I need to validate the information (dupes, password complexity, etc) - which should really happen in the Core Panel since it is shared by all the Panel*Impl classes.

Since the validation is occuring in the CorePanel class I need to call back to the PanelImpl to display/update the data the user has entered so far.

I cannot seem to find a way to do this. Is it possible to get a reference to the PanelImpl class being used so that I can call some sort of update() method in it?


thanks,
klein

jaystamm
04-30-2003, 11:37 AM
You might try using the propertyChanged method. In your base class call

propertyChanged("validatedInfo");

Then in your impl class you will have a method such as:

public void propertyChanged(String propertyName)
{
super.propertyChanged(propertyName); // required!

if (propertyName.equals("validatedInfo"))
{
updateMyCustomList();
}
}


ISMP will handle calling the correct impl's propertyChanged method. Hope this helps....

kleink
04-30-2003, 06:13 PM
There is a method in the WizardPanel class: getWizardPanelImpl() which will give you the current panel implementation class.

I forget where I found this, probably in one of the examples, but it works fine.