I have a Wizard with 3 WizardPages, each page with widgets holding inputs from the user, I need to add a last page, holding all the informations entered by the user.
I didn't know how to do that, because the 4 pages are created at the same time.
Public Wizard(){
addPage(new Page1()) ;
addPage(new Page2()) ;
addPage(new Page3()) ;
addPage(new PageSummary()) ;
}
How can i change PageSummary Controls depending on what is entered in previous pages ?
Edit:
I've found a post, that do exactly what i want, using the onEnterPage()
method looks clever, here is how i have tried it:
public class NewEquipementSummaryPage extends WizardPage {
public void createControl(Composite parent) {
// composite to hold widgets
Composite composite = new Composite(parent, SWT.NONE) ;
// composite layout
GridLayout gl = new GridLayout(2, false) ;
composite.setLayout(gl) ;
// making widgets
createWidgets(composite) ;
setControl(composite) ;
}
public void onEnterPage() {
TypeEquipementPage typePage = (TypeEquipementPage) getWizard().getPage(TypeEquipementPage.PAGE_NAME) ;
CompanySellerPage companyPage = (CompanySellerPage) getWizard().getPage(CompanySellerPage.PAGE_NAME) ;
EquipementUserPage userPage = (EquipementUserPage) getWizard().getPage(EquipementUserPage.PAGE_NAME) ;
if(typePage.types[0].getSelection() == true)
typeEquipementLabel.setText("Poste de travail") ;
else
typeEquipementLabel.setText("Peripherique") ;
marqueEquipementLabel.setText(typePage.marquesCombo.getText()) ;
descriptionEquipementLabel.setText(typePage.descriptionField.getText()) ;
if(companyPage.companyExistButton[0].getSelection() == true) {
companyNameLabel.setText(companyPage.companiesCombo.getText()) ;
}
else{
companyNameLabel.setText(companyPage.companyNameField.getText()) ;
companyAdressLabel.setText(companyPage.companyAdressField.getText()) ;
companyNumberLabel.setText(companyPage.companyNumberField.getText()) ;
}
if( !(userPage.sharedEquipementButton.getSelection()) )
useOfEquipementLabel.setText("Utilisateur") ;
else
useOfEquipementLabel.setText("Bureau") ;
pack() ;
}
With the pack() method in the end, i have an error in compilation (cannot find symbol)
and without it nothing appear in the page .. what did I miss ?