How to handle a TableField efficiently? [message #1783259] |
Fri, 09 March 2018 22:01 |
|
Scout: 6.0.200
Eclipse for Scout Developers:
Version: Oxygen.2 Release (4.7.2)
Build id: 20171218-0600
<< see image >>
Use case:
I would like to record the persons from a party (person table is in database available // Mapping table between persons and party is in the database available)
Description of the previous implementation:
I have a party form (A). In this form there are different elements (title, begin, etc.). Likewise a ParticipantsTableField (B) - with the columns "Firstname", "Lastname", "Mail", etc.
If I want to add a new person to the ParticipantsTableField (NewPersonMenu), an AddPersonForm (C) will be opened with a smartfield "PersonLookupCall". This field (PersonLookupCall) is also a master field for other invisible fields - just these additional fields like "Firstname", "Lastname", "Mail", etc.
The action of the NewPersonMenu is checked for an "if - isFormStored ()". If this is true, I create a new line in ParticipantsTableField (createRow) and set this to "Inserted" (setStatusInserted ()).
if (personForm.isFormStored()) {
Table table = getTable();
ITableRow r;
r = table.addRow(getTable().createRow());
table.getParticipantsIDColumn().setValue(r, UUID.randomUUID().toString());
table.getPersonIDColumn().setValue(r, personForm.getPersonSmartField().getValue());
table.getFirstNameColumn().setValue(r, personForm.getFirstNameField().getDisplayText());
table.getLastNameColumn().setValue(r, personForm.getLastnameField().getDisplayText());
table.getEmailColumn().setValue(r, personForm.getEmailField().getDisplayText());
r.setStatusInserted();
}
Everything works great! Now to my two questions:
- State of the art
Is that "state of the art" <or> can I improve? If yes how?
- Peoplegroup
Since often the same people come to a party, there is also a "group of people". Adopted in group "BSI-Core" are 10 persons. These should then be added to the table "ParticipantsTableField" when selecting this group (new menu in the ParticipantsTableField: AddPersonGroup). For this I can not use the AddPersonForm (C) - because there is only one person with hidden single fields and therefore not more people can be selected.
* How can I select a group of people and then access the database in the ParticipantsTableField menu?
* Or am I mentally in the wrong place?
Cheers and many Thanks
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03788 seconds