Display dynamic title instead of first displayed column in the tree for AbstractPageWithNodes [message #1863105] |
Tue, 16 January 2024 11:47  |
Eclipse User |
|
|
|
Hello,
I can't post my clients source code, so here is an abstract example to show the use case and hopefully the problem itself.
I have a table BookDetailsTablePage with the displayed columns:
- id, author, iban, genre, publishingDate
and a second table BookPriceTablePage with the displayed columns:
- iban, price, validFrom, validTo
Currently for the source code below the outline would look like this:
- Parent
-- Book Details
--- id01
---- Book Prices
--- id02
---- Book Prices
--- ...
--- idN
---- Book Prices
...
cause it takes the first displayed column. But what I want to archieve, is, that in the tree it always displays the iban no matter, which column is the first visible in BookDetailsTablePage.
Expected:
- Parent
-- Book Details
--- iban01
---- Book Prices
--- iban02
---- Book Prices
--- ...
--- ibanN
---- Book Prices
...
I tried to debug, where it chooses the first column itself instead of the configured title, but I didn't found it. In the debugger the childPages title is correct.
Am I missing something? Is it behaviour that can't be overridden? Any hint could be helpful.
Thanks and best regards
Marciana
Basic structure:
@Data(BookDetailsTablePageData.class)
public class BookDetailsTablePage extends AbstractPageWithTable<BookDetailsTablePage.Table> {
@Override
protected String getConfiguredTitle() {
return "Book details";
}
@Override
protected IPage<?> execCreateChildPage(ITableRow row) throws ProcessingException {
var childPage = new BookPriceNodePage();
childPage.setIban(getTable().getIbanColumn().getValue(row));
return childPage;
}
// ...
}
@Data(BookPriceTablePageData.class)
public class BookPriceTablePage extends AbstractPageWithTable<BookPriceTablePage.Table> {
@Override
protected String getConfiguredTitle() {
return "Book prices";
}
@Override
protected void execLoadData(SearchFilter filter) {
importPageData(BEANS.get(IBookPriceService.class).getBookPriceTableData((BookPriceSearchFormData) filter.getFormData()));
}
@Override
protected Class<? extends ISearchForm> getConfiguredSearchForm() {
return BookPriceSearchForm.class;
}
// ...
}
public class BookPriceSearchForm extends AbstractSearchForm {
//...
}
public class BookPriceNodePage extends AbstractPageWithNodes {
private String iban;
@Override
protected String getConfiguredTitle() {
return this.iban;
}
@Override
protected void execCreateChildPages(List<IPage<?>> pageList) {
var bookPriceTablePage = new BookPriceTablePage();
bookPriceTablePage.setSearchRequired(false);
var searchForm = new BookPriceSearchForm();
searchForm.getIbanField().setValue(this.iban);
searchForm.setEnabled(false);
searchForm.setEnabledGranted(false);
bookPriceTablePage.setSearchForm(searchForm);
pageList.add(bookPriceTablePage);
}
@FormData
public void setIban(String iban) {
this.iban = iban;
}
//...
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03457 seconds