Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Open a maximized form from the outline
Open a maximized form from the outline [message #1867002] Tue, 11 June 2024 20:40 Go to next message
Eclipse UserFriend
Hello,

Is it possible to directly open a form in maximized modewhen I click on a page in the outline?

For example, in the BSI widgets, you have the CalendarFieldForm. Can it be directly opened in a maximized state when clicking on the outline?

I would like to get rid of the header/menu for this form only and have more space on screen

[Updated on: Tue, 11 June 2024 21:06] by Moderator

Re: Open a maximized form from the outline [message #1867014 is a reply to message #1867002] Wed, 12 June 2024 05:06 Go to previous messageGo to next message
Eclipse UserFriend
There is not a single property for this. Instead, some parts of the desktop can be hidden individually:

    IDesktop desktop = IDesktop.CURRENT.get();
    desktop.setNavigationVisible(false);
    desktop.setNavigationHandleVisible(false);
    desktop.setHeaderVisible(false);


You can test this here: https://scout.bsiag.com/widgets/?dl=widget-desktop

Is this the only form in your application? If yes, you can try to set the property "displayStyle" of the desktop to DISPLAY_STYLE_BENCH. Otherwise, you could add a "fullscreen menu" to your form, or run this code on the page activate event. But make sure you provide a way to make the hidden elements visible again, otherwise the user would not be able to select other pages anymore.

Beat
Re: Open a maximized form from the outline [message #1867017 is a reply to message #1867014] Wed, 12 June 2024 07:07 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your response. However, I would prefer not to manage the visibility of the header myself, which is why I would rather implement something that works like a simple form.

Just like something I can execute from a button:

MyForm form = new MyForm();
form.setMaximized(true);
form.setModal(true);
form.setDisplayHint(DISPLAY_HINT_DIALOG);
form.setClosable(true);
form.start();

I would like to execute this same code when clicking on a page in the outline.
then when closing the form -> back to the outline menu.

I am asking this to have more usable space on the phone when looking at a calendar form. The desktop.setHeaderVisible(false); does not seem to work on phone anyway.

is it possible?

[Updated on: Wed, 12 June 2024 07:08] by Moderator

Re: Open a maximized form from the outline [message #1867020 is a reply to message #1867017] Wed, 12 June 2024 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Easy. Run your code when the page is activated:

public class MyPage extends AbstractPageWithNodes {
  @Override
  protected String getConfiguredTitle() {
    return TEXTS.get("MyPage");
  }

  @Override
  protected boolean getConfiguredLeaf() {
    return true;
  }

  @Override
  protected void execPageActivated() {
    MyForm form = new MyForm();
    form.setMaximized(true);
    form.setModal(true);
    form.setDisplayHint(DISPLAY_HINT_DIALOG);
    form.setClosable(true);
    form.start();
  }
}


You might also want to provide a detail form that has a "reopen" button to allow the user to open MyForm again without first selecting a different page and coming back.

Beat
Re: Open a maximized form from the outline [message #1867038 is a reply to message #1867020] Wed, 12 June 2024 10:21 Go to previous messageGo to next message
Eclipse UserFriend
I have already tried something similar but I could not find a way to also close the "MyPage" so that when an user close the form, he goes back main page where he sees all the pages in the outline?
I have tried to dispose the page when closing the form, but was not successful, maybe somthing I did not understood with the page lifecycle.
It could simplify the process and avoid this "reopen" button.

[Updated on: Wed, 12 June 2024 11:23] by Moderator

Re: Open a maximized form from the outline [message #1867044 is a reply to message #1867038] Wed, 12 June 2024 15:15 Go to previous messageGo to next message
Eclipse UserFriend
I would like to use something like that
Desktop.get().activateOutline(Desktop.get().getAvailableOutlines().get(0)); 
or
myPage.dispose()
in the execDisposeForm() method of the form but no success.

Also tried to trigger the back button in the page (the one which shorcut is backspace)

Note : If I try
Desktop.get().activateOutline(Desktop.get().getAvailableOutlines().get(1));
It works and open the second outline, but since the page is in the first outline, It seems I cannot display it

Finally solved it using

Desktop.get().getOutline().resetOutline(false);

[Updated on: Wed, 12 June 2024 15:46] by Moderator

Re: Open a maximized form from the outline [message #1867080 is a reply to message #1867044] Fri, 14 June 2024 03:46 Go to previous messageGo to next message
Eclipse UserFriend
I see. You are (ab)using the outline tree as a kind of menu system. This is not really its indended purpose, but nevertheless it should be possible to achieve the desired effect.

The outline as just a special tree widget and a page is just a special tree node. execPageActivated() gets called when the tree node is about to be selected. So opening the form at this point is correct. What remains is jumping back to the previously selected node. This can be done by programmatically selecting a different tree node. Because during execPageActivated(), the new node is not yet selected internally, we have to wrap this call in a separate model job.

public class MyPage extends AbstractPageWithNodes {
  @Override
  protected String getConfiguredTitle() {
    return TEXTS.get("MyPage");
  }

  @Override
  protected boolean getConfiguredLeaf() {
    return true;
  }

  @Override
  protected void execPageActivated() {
    // Open form
    MyForm form = new MyForm();
    form.setMaximized(true);
    form.setModal(true);
    form.setDisplayHint(DISPLAY_HINT_DIALOG);
    form.setClosable(true);
    form.start();

    // Deselect page
    ModelJobs.schedule(() -> {
      getOutline().deselectNode(this); // or: getOutline().selectNode(this.getParentNode());
    }, ModelJobs.newInput(ClientRunContexts.copyCurrent()));
  }
}


Beat
Re: Open a maximized form from the outline [message #1867149 is a reply to message #1867080] Mon, 17 June 2024 05:54 Go to previous message
Eclipse UserFriend
I was able to achieve this by using
Desktop.get().getOutline().resetOutline(false);
in my execDisposeForm method. Thank you very much for the additional details; they were very helpful.
Previous Topic:[Solved] Project build failure due to Node.js v20.13.1. Missing yargs-parser?
Next Topic:LookupCall on BigDecimal
Goto Forum:
  


Current Time: Fri Jun 20 07:36:52 EDT 2025

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

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

Back to the top