Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Scout/Concepts/Page Detail Form"

m
Line 1: Line 1:
 
{{ScoutPage|cat=Client}}
 
{{ScoutPage|cat=Client}}
A page detail form is an ordinary {{ScoutLink|Concepts|Form}} which is attached to a {{ScoutLink|Concepts|Page}}. This form migth be {{ScoutLink|HowTo/3.8|Open a Form in a View|opened in a view }}.
+
A page detail form is an ordinary {{ScoutLink|Concepts|Form}} which is attached to a {{ScoutLink|Concepts|Page}}. This form might be {{ScoutLink|HowTo/3.8|Open a Form in a View|opened in a view }}.
  
 
== Description ==
 
== Description ==

Revision as of 05:43, 30 January 2014

The Scout documentation has been moved to https://eclipsescout.github.io/. A page detail form is an ordinary The Scout documentation has been moved to https://eclipsescout.github.io/. which is attached to a The Scout documentation has been moved to https://eclipsescout.github.io/.. This form might be The Scout documentation has been moved to https://eclipsescout.github.io/..

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 The Scout documentation has been moved to https://eclipsescout.github.io/. on The Scout documentation has been moved to https://eclipsescout.github.io/.). 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.

Note.png
Start vs Show
Note the difference between starting and showing a form. Starting means executing the form handler which normally loads the data and fills the fields. Showing the form means displaying it. This is normally automatically done after the form has been started. In case of the detail form it's not because the property autoAddRemoveOnDesktop is set to false by the method setDetailForm(). Now the form explicitly needs to be added to the desktop which will tell the UI to display it.

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 The Scout documentation has been moved to https://eclipsescout.github.io/. to false.

@Override
protected boolean getConfiguredTableVisible() {
  return false;
}

See also

Copyright © Eclipse Foundation, Inc. All Rights Reserved.