| opening multiple editors [message #757701] |
Mon, 21 November 2011 04:56  |
Bertin Kiekebosch Messages: 223 Registered: August 2011 |
Senior Member |
|
|
Hi,
I have an outline and a table page. Default behaviour is when I then want to add or modify an element from the table view, the form is opened as modal dialog.
What I try to do is instead is not to open a modal dialog but open the form in an other view. There is a tuturial about this and it works OK.
Now I like to open multiple editors. But when another element from the list is selected, nothing happens. In the console there is a Message:
!MESSAGE org.eclipse.scout.rt.ui.swt.window.desktop.view.AbstractScoutView.showForm(AbstractScoutView.java:89) The view 'ID=nl.rid.grammastudio6.ui.swt.views.EditorView' is already open. The form 'Zinnen (nl.rid.grammastudio6.client.ui.forms.ZinnenForm)' can not be opened!
I know how to do this in SWT (with the help of IEditorInput): Open multiple windows in a view. (and if the user selects the same record twice the same window is opened). In fact it is the same behaviour as the editor in Eclipse.
The question is, do I have to implement this myself or is this concept supported by Scout, and if yes, how should I do this.
Regards Bertin
|
|
|
| Re: opening multiple editors [message #757772 is a reply to message #757701] |
Mon, 21 November 2011 10:31  |
 |
Claudio Guglielmo Messages: 98 Registered: March 2010 |
Member |
|
|
Hi Bertin
Try setting allowMultiple at your view to true. This makes sure a secondaryViewId is generated in order to distinguish the views. This should solve your problem.
Now if you want to open/activate the same view when the same record is selected you have modify your ZinnenForm a little. You need to start your form in exclusive mode and compute an exclusive key (typically the primary key of your entity) which distinguishes the records.
public class ViewHandler extends AbstractFormHandler {
@Override
protected void execLoad() throws ProcessingException {
//open form code
}
@Override
protected boolean getConfiguredOpenExclusive() {
return true;
}
}
public void startView() throws ProcessingException {
startInternalExclusive(new DesktopForm.ViewHandler());
}
@Override
public Object computeExclusiveKey() throws ProcessingException {
return RECORD_ID;
}
}
Please notice: You need to set getConfiguredExclusive to true AND start the handler by using startInternalEXCLUSIVE.
Btw: I've added this additional information to the howto: http://wiki.eclipse.org/Scout/HowTo/Open_a_Form_in_a_View
Have fun 
Regards
Claudio
[Updated on: Mon, 21 November 2011 11:42] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01452 seconds