Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Scout/Concepts/Page Detail Form
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
A page detail form is an ordinary Form which is attached to a Page. This form migth be opened in a view.
Description
A page detail form is typically created and started when the page gets activated. With the function IPage#setDetailForm()
it can be attached to the page. Until now the page resp. the desktop takes care of showing and hiding the form on page activation and deactivation.
The following code shows an example how to create and attach a detail form.
@Override protected void execPageActivated() throws ProcessingException { if (getDetailForm() == null) { PersonDetailForm form = new PersonDetailForm(); form.setPersonNr(getPersonNr()); setDetailForm(form); form.startView(); } }
As already said, attaching a detail form to a page means the detail form will automatically be hidden when the page gets deactivated and shown when the page gets activated (see PageDetailFormChanged on Desktop). So the detail form actually gets cached and does not need to be started more than once per page. This requires that the form does not get closed.
This is how it is done mostly. If you have a special kind of detail form which requires explicit closing, you could do this on page deactivation. But remember: This will break the caching and the form always needs to be started again on page activation.
@Override protected void execPageDeactivated() throws ProcessingException { if (getDetailForm() != null) { getDetailForm().doClose(); setDetailForm(null); } }
If you would like to hide the page table and only show the detail form instead, you can set the property tableVisible to false
.
@Override protected boolean getConfiguredTableVisible() { return false; }