Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Display dynamic title instead of first displayed column in the tree for AbstractPageWithNodes
Display dynamic title instead of first displayed column in the tree for AbstractPageWithNodes [message #1863105] Tue, 16 January 2024 16:47 Go to next message
Marciana Naue is currently offline Marciana NaueFriend
Messages: 2
Registered: April 2023
Junior Member
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;
  }
  
  //...
}
Re: Display dynamic title instead of first displayed column in the tree for AbstractPageWithNodes [message #1863110 is a reply to message #1863105] Tue, 16 January 2024 21:28 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 232
Registered: September 2011
Senior Member
Hi Marciana

What you are looking for is implemented in the class SummaryCellBuilder.
The cell displayed to identify a row in the outline tree is called summary cell.

By default it takes the first visible column. But you can specify which column should be used as summary:

In the column you want to use overwrite the method getConfiguredSummary() and return true. Then this column will be used.

Hope this helps
Mat
Re: Display dynamic title instead of first displayed column in the tree for AbstractPageWithNodes [message #1863124 is a reply to message #1863110] Wed, 17 January 2024 08:24 Go to previous message
Marciana Naue is currently offline Marciana NaueFriend
Messages: 2
Registered: April 2023
Junior Member
Hello Matt,

thanks a lot for the fast reply and the solution. This works perfectly!

Best regards
Marciana
Previous Topic:SimplePrincipal with a specified user name not working as expected after login
Next Topic:Icons missing after font change
Goto Forum:
  


Current Time: Sat May 18 04:09:16 GMT 2024

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

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

Back to the top