|
|
(19 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | {{note|Scout Tutorial|This page belongs to the {{ScoutLink|Tutorial|Minicrm Step-by-Step|Minicrm Step-by-Step Tutorial}}. It explains how create your second page in your project and use it as a child page for your first page. You need to have {{ScoutLink|Tutorial|Write The First Page|an existing table page}} in order to continue. You should als have a {{ScoutLink|Tutorial|Add a form|working form to add more companies}}; this is how we're going to test our application.}}
| + | The Scout documentation has been moved to https://eclipsescout.github.io/. |
− | | + | |
− | We already have a page for companies. Quickly create a second top-level page for persons. Then reuse the same page as child page for the existing company page.
| + | |
− | | + | |
− | == A new table page ==
| + | |
− | | + | |
− | Refer to the instructions on how to {{ScoutLink|Tutorial|Write The First Page|write your first page}} if you're lost.
| + | |
− | | + | |
− | Here are some notes to guide you:
| + | |
− | | + | |
− | Add <tt>getPersonTableData</tt> to the '''StandardOutlineService'''. Use <tt>SELECT PERSON_NR, LAST_NAME, FIRST_NAME FROM PERSON</tt> as your SQL statement.
| + | |
− | | + | |
− | [[Image:Person.jpg]]
| + | |
− | | + | |
− | If you edited StandardOutlineService manually, make sure to add <tt>getPersonTableData</tt> to the interface '''IStandardOutlineService''' as well.
| + | |
− | | + | |
− | <tt>getPersonTableData</tt> doesn't need a parameter, unless you want to create a '''PersonSearchForm''' as well; you don't need to do this for the tutorial, but it might be an excellent excercise
| + | |
− | | + | |
− | Add a '''New Page...''' to ''Child Pages'' of the '''StandardOutline'''; it uses the ''AbstractPageWithTable'' template, has the name ''Person'' and the type name ''PersonTablePage''
| + | |
− | | + | |
− | This is how the '''StandardOutline has two child pages''', now:
| + | |
− | | + | |
− | <source lang="java">
| + | |
− | protected void execCreateChildPages(Collection<IPage> pageList) throws ProcessingException {
| + | |
− | CompanyTablePage companyTablePage = new CompanyTablePage();
| + | |
− | pageList.add(companyTablePage);
| + | |
− | PersonTablePage personTablePage = new PersonTablePage();
| + | |
− | pageList.add(personTablePage);
| + | |
− | }
| + | |
− | </source>
| + | |
− | | + | |
− | This is how the '''PersonTablePage loads data''' from the outline service:
| + | |
− | | + | |
− | <source lang="java">
| + | |
− | @Override
| + | |
− | protected Object[][] execLoadTableData(SearchFilter filter) throws ProcessingException {
| + | |
− | return SERVICES.getService(IStandardOutlineService.class).getPersonTableData();
| + | |
− | }
| + | |
− | </source>
| + | |
− | | + | |
− | Add the following '''columns''' to the table inside the ''PersonTablePage'':
| + | |
− | | + | |
− | {|
| + | |
− | |Table Column Template
| + | |
− | |Name
| + | |
− | |Type Name
| + | |
− | |Note
| + | |
− | |-
| + | |
− | |Long Column
| + | |
− | |(empty)
| + | |
− | |PersonNrColumn
| + | |
− | |not displayable
| + | |
− | |-
| + | |
− | |String Column
| + | |
− | |Last Name
| + | |
− | |LastNameColumn
| + | |
− | |width 200
| + | |
− | |-
| + | |
− | |String Column
| + | |
− | |First Name
| + | |
− | |FirstNameColumn
| + | |
− | |width 200
| + | |
− | |}
| + | |
− | | + | |
− | Test it! The login I keep using is username '''admin''' password '''manager'''. This is what it should look like:
| + | |
− | | + | |
− | [[Image:Scout Application With Person Page.png]]
| + | |
− | | + | |
− | == Using a table page as a child page to another page ==
| + | |
− | | + | |
− | Return to the '''CompanyTablePage''', click through to ''Child Page'', and pick '''Add Page...''' (we don't need to create a ''new'' page because we want to reuse the ''person table page''), and pick
| + | |