|
Re: MasterDetails and inital master selection [message #713826 is a reply to message #710639] |
Tue, 09 August 2011 06:45 |
|
Hi,
You need to set the selection after the details parts are registered to master.
In the typical code where master and details are registered add code like following:
protected void createFormContent(final IManagedForm managedForm) {
super.createFormContent(managedForm);
this.managedForm = managedForm;
this.form = managedForm.getForm();
this.toolkit = managedForm.getToolkit();
form.setText("Heading");
form.setImage("Some image");
toolkit.decorateFormHeading(form.getForm());
dtMasterDetailBlock = new EditorMasterDetailBlock(this, file, populateForDTEnumConstant, model, rootDataType, callback, domain);
Composite formBody = form.getBody();
formBody.setLayout(new GridLayout(1, false));
SashForm sashForm = new SashForm(formBody, SWT.NULL);
GridDataFactory.fillDefaults().grab(true, true).applyTo(sashForm);
toolkit.adapt(sashForm, false, false);
dtMasterDetailBlock.createMasterPart(managedForm, sashForm);
DetailsPart detailsPart = new DetailsPart(managedForm, sashForm, SWT.NULL);
managedForm.addPart(detailsPart);
dtMasterDetailBlock.registerPages(detailsPart);
dtMasterDetailBlock.createToolBarActions(managedForm);
dtMasterDetailBlock.setInitialSelection();
}
Check location of : dtMasterDetailBlock.setInitialSelection();
Regards,
Ashwani Kr Sharma
|
|
|
Powered by
FUDForum. Page generated in 0.03455 seconds