Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » [HOW TO] pass two or more arguments to the Child TablePage(The transfer of significant fields from the Parent TablePage to the Child TablePage.)
[HOW TO] pass two or more arguments to the Child TablePage [message #1716607] Sun, 06 December 2015 09:22 Go to next message
barust Mising name is currently offline barust Mising nameFriend
Messages: 57
Registered: February 2014
Member
Hi there.
I want to share how I solved this problem, maybe it will help someone in the future.
This is nothing new, all taken from the tutorial (http://wiki.eclipse.org/Scout/Tutorial/5.0/Minicrm/Write_the_second_page), and the only thing that I want to pay attention to when performing this task in the future.

For example, I have two TablePages:
- TalonSotrsTablePage as a Parent TablePage
where two important fields:
- YearsColumn
- MonthsColumn
http://imageshack.com/i/hl0YrHzRp

- TalonSotrDetailsTablePage as a Child TablePage
where I also have the fields:
- YearsColumn
- MonthsColumn
http://imageshack.com/i/p7iN36dGp

then I want to pass the field values Years and Months to the Child TablePage.
I created two property beans (Years and Months) in the TalonSotrDetailsTablePage ChildPage.

Important!
I checked out to the fields Years and Months on the TalonSotrDetailsTablePage ChildPage as the primary key:

http://imageshack.com/i/pb7uFlWgp http://imageshack.com/i/pbAuQG5vp

On execCreateChildPage metod of the ParenPage TalonSotrsTablePage I wrote as follows:
@Override
protected IPage execCreateChildPage(ITableRow row)  throws ProcessingException {
	TalonSotrDetailsTablePage childPage = new TalonSotrDetailsTablePage();
	
        childPage.setYears(getTable().getYearsColumn().getValue(row));
	childPage.setMonths(getTable().getMonthsColumn().getValue(row));

	return childPage;
}


On execLoadData metod of the ChildPage TalonSotrDetailsTablePage I wrote as follows:
@Override
protected void execLoadData(SearchFilter filter) throws ProcessingException {
	importPageData(SERVICES.getService(ITalonsOutlineService.class)
        .getTalonSotrDetailsTableData(getYears(), getMonths()));
}


Then I created with wizard on my OutlineService new service operation as follows:
http://imageshack.com/i/p30zfAPVp

Conclusion:
When you pass significant fields from the Parent TablePage to the Child TablePage you must:
- Have same fields on the ChildPage;
- Mark this same fields as the Primary Keys;
- Create (for passed fields) appropriate property beans on the ChildPage;

That's all.


P.S.:
You can say that I repeated the tutorial, yes of course.
But by this post I wanted to focus attention on using the primary key properiie of columns, which is not indicated in the tutorial.
And on this problem I lost a lot of time. Sad

I would be glad if someone can help in the future. If I made a mistake somewhere or done wrong I will be glad to hear

Barust

[Updated on: Sun, 06 December 2015 09:55]

Report message to a moderator

Re: [HOW TO] pass two or more arguments to the Child TablePage [message #1717043 is a reply to message #1716607] Wed, 09 December 2015 17:46 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Thank you for sharing this here. Your analysis is absolutely correct and I hope it will help other.

It is difficult to cover each aspect of the Framework in a simple tutorial.
Re: [HOW TO] pass two or more arguments to the Child TablePage [message #1717115 is a reply to message #1717043] Thu, 10 December 2015 04:14 Go to previous message
barust Mising name is currently offline barust Mising nameFriend
Messages: 57
Registered: February 2014
Member
Thank you Jérémie,
for your reply.

First of all, we should thank Scout Team and BSI AG for these tutorials! Tutorials are self-sufficient to get an idea and begin to create a ready-made programs.
Of course, the ideal is nothing in the world. And of course, pleased that there is a Scout forum and Scout Contributers that make the platform better.
Thanks to all !

Bakhtiyor (Barust)
Previous Topic:[NEON M3] Project build error
Next Topic:Java.lang.ClassCastException: Mockito
Goto Forum:
  


Current Time: Fri Apr 19 19:26:00 GMT 2024

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

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

Back to the top