Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » AbstractPageField for creating sub-forms
AbstractPageField for creating sub-forms [message #1852406] Sat, 14 May 2022 14:05 Go to next message
J D is currently offline J DFriend
Messages: 95
Registered: February 2021
Member
Hi there,

I have a user requirement that demands the creation of a sub-form (a form embedded in another form). On the database level, the link between the two forms is the employee ID.

I've tried to put the sub-form in a GroupBox with an AbstractPageField. I have used the AbstractPageField before elsewhere to display master tables and their detail forms. I figured that I could use it for this particular use case also by hiding the table and displaying only the form. But I have thus far being unsuccessful.

This is what I did:

This code is part of a group box on my EmployeeForm.java
      /*
       * the embedded Exit form
       */
      @Order(500)
      public class EmployeeExitPage extends AbstractPageField<ExitNodePage> {

        @Override
        protected void execInitField() {
          setPage(new ExitNodePage());
          ((ExitForm) getPage().getDetailForm()).getExitFormBox().initializeExitForm();
        }
      }


This is the ExitNodePage.java class
public class ExitNodePage extends AbstractPageWithNodes {

  /*
   * No table is used on this page
   */
  // @Override
  // protected void execInitPage() {
  // setTableVisible(false);
  // }

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

  /*
   * the embedded Exit form
   */
  @Override
  protected Class<? extends IForm> getConfiguredDetailForm() {
    return ExitForm.class;
  }
}


As is, the best I can get is an empty table with the ExitForm below it. If I try to setTableVisible(false) OR return false from getConfiguredTableVisible() in ExitNodePage.java, the Employee form does not display at al.

Is there anyway I can get around this problem? Or is there any other way this can be achieved?

Cheers,

JD

[Updated on: Sat, 14 May 2022 14:35]

Report message to a moderator

Re: AbstractPageField for creating sub-forms [message #1852430 is a reply to message #1852406] Mon, 16 May 2022 11:13 Go to previous messageGo to next message
Luka Cavic is currently offline Luka CavicFriend
Messages: 47
Registered: August 2014
Member
Hi, you need field of type: AbstractWrappedFormField<IForm>.

And set form to it using: setInnerForm(YourFormInstance)

See: https://scout.bsi-software.com/widgets/?dl=widget-wrappedformfield
Re: AbstractPageField for creating sub-forms [message #1852466 is a reply to message #1852430] Tue, 17 May 2022 11:17 Go to previous message
J D is currently offline J DFriend
Messages: 95
Registered: February 2021
Member
It worked! Thank you very much for your advice, Luka.

JD

Previous Topic:How to add Country Flag to phone number field
Next Topic:Resize the splitter padding & Intelij plugin not working correctly
Goto Forum:
  


Current Time: Tue Mar 05 08:50:34 GMT 2024

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

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

Back to the top