Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Re-use Table class used in TablePage and in Form
Re-use Table class used in TablePage and in Form [message #1816799] Thu, 07 November 2019 09:04 Go to next message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Hi,

I would like to consolidate the Table used in a TablePage and in a Form to be an instance of the same Table class. The columns to be shown in both instances are slighly different, i.e.

- In the TablePage, I would like to show all the columns
- In the Form, I would like to show a subset of the columns

I am using an Enum to distingush the two use cases.

At the moment it is sort of working, the problem is that the TablePage shows no columns when when first access and Ithink this is because its configuredVisible() method is called when the platform is starting up or at outline creation time.

An added bonus would be if I could also consolidate the RowData classes that is generated for the Form and TablePage. If I need to remove the @Data annotation and manage this manually then I am happy to do this but thought there might be another way.


Kind regards,
Mark Ashworth
Re: Re-use Table class used in TablePage and in Form [message #1816811 is a reply to message #1816799] Thu, 07 November 2019 13:33 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Mark

You try to re-use the same table in a TablePage and in a Form, additionally you probably want to re-use the same service to fill that table in the TablePage and in the Form (I guess that's why you asked about the @Data annotation), right?

Well, i have bad and good news :-)

The bad news is, even when you use the same AbstractMyTable class in your TablePage and in your Form the Scout SDK generates two different RowData classes for the table. Thus you cannot fill them with the same service method. As a workaround you could make a service method that returns a plain Java bean, use that same service in the TablePage and in the Form and map the properties from the bean manually to the table.

The good news is, you can re-use a TablePage in a Form with the AbstractPageField. We have discussed that approach in this thread. By implementing the execInitField() method of the PageField you can set some columns to visibleGranted=false, so they show up in the TablePage, but not in the form.

Cheers,
André


Eclipse Scout Homepage | Documentation | GitHub
Re: Re-use Table class used in TablePage and in Form [message #1816853 is a reply to message #1816811] Fri, 08 November 2019 12:28 Go to previous message
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Hi Andre,

Thank you for the information, I think the AbstractPageField is what I am looking for :-)

Regards,
Mark
Previous Topic:Database Connection Pool causing JUnit tests to timeout
Next Topic:How I can localize texts in ui javascript (frontend)
Goto Forum:
  


Current Time: Wed Apr 24 22:39:53 GMT 2024

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

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

Back to the top