Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Second Page in Wizard is Blank (Composite)
Second Page in Wizard is Blank (Composite) [message #464313] Mon, 21 November 2005 13:11 Go to next message
Eclipse UserFriend
Originally posted by: sascha.goldsmith.flagstar.com

Gurus,

I have been attempting for several hours to get a simple wizard to work.
I am trying to have the user select one of two radio buttons prior to
picking 'next' in a Wizard. Once this is done, the wizard flow will
proceed normally. The first page of my Wizard displays fine. However,
regardless of which radio button I select, the next Wizard page is gray.

I know that the createControl() method is being called because the call to
setTitle() in that method is working fine. No matter what type of
controls I add to the Composite, nothing is shown. When I click 'back',
the previous Wizard page displays fine. I have attached the call from the
first Wizard page (SelectActionPage) and the next Wizard page
(SelectSearchTypePage). I would appreciate any help that you can offer.
My thanks in advance.

- Sascha

// First Wizard Page (displays fine)

public class SelectActionPage extends WizardPage {

final IWizardPage searchPage;
final IWizardPage statusPage;
IWizardPage activePage;

final public void createControl(Composite parent) {

setTitle("Main Menu");
Composite main = new Composite(parent, SWT.NONE);
setControl(main);
GridLayout layout = new GridLayout();
main.setLayout(layout);
layout.numColumns = 1;
layout.verticalSpacing = 20;
GridData itemLayout = new GridData();
itemLayout.widthHint = 200;
itemLayout.horizontalAlignment = SWT.LEFT;
Button searchButton = new Button(main, SWT.RADIO);
searchButton.setText("Search Repository");
searchButton.setLayoutData(itemLayout);
searchButton.addSelectionListener(new SelectionAdapter() {

public void widgetSelected(final SelectionEvent evt) {

activePage = searchPage;
getWizard().getContainer().updateButtons();
}
});
Button statusButton = new Button(main, SWT.RADIO);
statusButton.setText("ISPT Status");
statusButton.setLayoutData(itemLayout);
statusButton.addSelectionListener(new SelectionAdapter() {

public void widgetSelected(final SelectionEvent evt) {

activePage = statusPage;
getWizard().getContainer().updateButtons();
}
});
}

final public boolean canFlipToNextPage() {

return (activePage != null);
}

final public IWizardPage getNextPage() {

return activePage;
}
}

// Second Wizard page (title gets set but no controls appear)

public class SelectSearchTypePage extends WizardPage {

final public void createControl(Composite parent) {

setTitle("Select Search Type");
Composite main = new Composite(parent, SWT.NONE);
setControl(main);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 10;
main.setLayoutData(layout);
GridData itemLayout = new GridData();
itemLayout.widthHint = 100;
Button untaggedButton = new Button(main, SWT.RADIO);
untaggedButton.setText("Untagged Files");
untaggedButton.setLayoutData(itemLayout);
Button advancedButton = new Button(main, SWT.RADIO);
advancedButton.setText("Advanced Search");
advancedButton.setLayoutData(itemLayout);
main.layout(true);
}
}
Re: Second Page in Wizard is Blank (Composite) [message #464345 is a reply to message #464313] Mon, 21 November 2005 20:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

Sascha <sascha.goldsmith@flagstar.com> wrote:
> Gurus,
>
> I have been attempting for several hours to get a simple wizard to
> work. I am trying to have the user select one of two radio buttons
> prior to picking 'next' in a Wizard. Once this is done, the wizard
> flow will proceed normally. The first page of my Wizard displays
> fine. However, regardless of which radio button I select, the next
> Wizard page is gray.
> I know that the createControl() method is being called because the
> call to setTitle() in that method is working fine. No matter what
> type of controls I add to the Composite, nothing is shown. When I
> click 'back', the previous Wizard page displays fine. I have
> attached the call from the first Wizard page (SelectActionPage) and
> the next Wizard page (SelectSearchTypePage). I would appreciate any
> help that you can offer. My thanks in advance.
>
One problem I see is that you are reusing GridData objects for multiple
widgets.
You can't do that. You have to create a new GridData for each widget.

--
Sunil
Re: Second Page in Wizard is Blank (Composite) [message #464348 is a reply to message #464345] Mon, 21 November 2005 21:08 Go to previous message
Eclipse UserFriend
Originally posted by: sascha.goldsmith.flagstar.com

Sunil, thanks so much for the quick response. I will modify my code and
see if that addresses the issue.

Thanks,
Sascha
Previous Topic:Moving focus to the next table cell in TableViewer
Next Topic:[MenuItem] - Text Color
Goto Forum:
  


Current Time: Mon Dec 09 17:47:08 GMT 2019

Powered by FUDForum. Page generated in 0.01569 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top