Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Calling a TablePage from somewhere other than the Outline
Calling a TablePage from somewhere other than the Outline [message #1814177] Thu, 05 September 2019 09:48 Go to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
Hi,

I searched the Scout documentation and the internet, but could not find how a TablePage (created with the wizard "Scould Page") can be initialized/started
from somewhere other than the outline (execCreateChildPages ... ad.d the ..TabelPage).

Hopefully this is possible.

Thanks!
Re: Calling a TablePage from somewhere other than the Outline [message #1814189 is a reply to message #1814177] Thu, 05 September 2019 12:05 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 Faruk

In Scout a Page and the Outline are two parts of the same concept. One without the other usually makes not a lot of sense. In some rare cases you may want to re-use a Page you've already programmed within a Form. For that you can use the AbstractPageField, which accepts a Page instance (the screenshot here shows what that field does). An example for the PageField is in our widget app here. Click on "View source on GitHub" to see the source code.

If that doesn't help, please describe your use-case and why you need to have a page outside of an outline.

Cheers,
André


Eclipse Scout Homepage | Documentation | GitHub
Re: Calling a TablePage from somewhere other than the Outline [message #1814190 is a reply to message #1814189] Thu, 05 September 2019 12:25 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
Hi André,

thanks for your answer.

We are just in the process of "transporting" our application to a new platform which Scout in general supports (our current thinking). So Scout is amongst others a framework which we are evaluating in order to find out what we have to do and what the workload will be.

We have assumed, that we use the outline area for the main/core business functionalities. But of course there are also non-core areas, which we wanted to place in menues (like the Quick Access in the contact demo with the sub-menues New....). Nevertheless we wanted to give the user the same working process as the TabelPage->Form. So we have produced an example with a xxxTabePage and xxxForm (according the Beginners Guide) which works fine, if we put it in the starting point in the outline area. But due to the fact, that xxx is a non-core functionality we just wanted the start up the xxxPage from a menu.

I just tried your suggestion with the PageFiield wich works very fine. Tanks!!!

But I could not figure out wat the folling line mean;

((DetailForm) getPage().getDetailForm()).getNavigationButtonInfoField().setVisible(false);


The "Advanced Widgets" demo is not available from the scout site., so the PageField is not mentioned neither the widgets or JS widgets demo. Are there more interessting widget?

Ceers
Faruk

[Updated on: Thu, 05 September 2019 14:27]

Report message to a moderator

Re: Calling a TablePage from somewhere other than the Outline [message #1814226 is a reply to message #1814190] Fri, 06 September 2019 06:47 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 Faruk

You're welcome.

> ((DetailForm) getPage().getDetailForm()).getNavigationButtonInfoField().setVisible(false);

The DetailForm.java used in that example is used in regular outline/page and also embedded in the PageFieldForm using the PageField. The DetailForm has an NavigationButtonInfoField with a label that says "Tip: Use the navigation buttons above to toggle between detail form and detail table." - Since these navigation buttons are only visible when the page is used in the regular outline, the programmer of the PageField decided to simply hide that label when the page is used in a Form. I guess the code simply demonstrates how you can modify properties of the detail-form of a page when you use the PageField.

> The "Advanced Widgets" demo is not available from the scout site

Well, it should be available. When you start on the Scout homepage here, and click on "Demo" > "Scout Widgets" the widget-app should be opened starting with the "Simple widgets" outline. But you can switch to the other outlines, including "Advanced widgets" anytime, when you click on the arrow in the upper left corner. Maybe the navigation item there is too hidden when you encounter a typical Scout application for the first time?

André


Eclipse Scout Homepage | Documentation | GitHub

[Updated on: Fri, 06 September 2019 06:47]

Report message to a moderator

Re: Calling a TablePage from somewhere other than the Outline [message #1814312 is a reply to message #1814226] Mon, 09 September 2019 09:55 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
thanks Andre.

I am struggling with the form which includes the TablePage and the DetailForm.

I tried according the example you have povided, and the page and DetailForm show up in one Form. But what I am missing is the linkage between the two. Means double-click in the table loads the required data in the DetailForm. Apprantly this has to be handled in a different way than the "normal" TablePage and the DetailForm. With getDetailForm() I can get the DetailForm in Tage TablePage. startModify() does not work, because the DetailForm is already loaded.

Just to detail my question: If I already have a TablePagee and the DetailForm which works find in the outline context. Can I reuse exactly these two 1:1 within the PageField-Context, which means creating a new form and working in this new Form with the PageField (and the DetailsForm)? I guess there are a few things to be changed, because when I resued a TablePage and the Details Form, the two showed up in the new form but opened a new form, when Edit or New have been chosen.

Hopefully my question where not too confusing or silly.

Thanks.

[Updated on: Mon, 09 September 2019 10:27]

Report message to a moderator

Re: Calling a TablePage from somewhere other than the Outline [message #1814501 is a reply to message #1814312] Thu, 12 September 2019 11:32 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 Faruk

I guess you are right. When you plan to use the same Page class you probably have to tweak a few things. For instance you probably want your menus to do different things when the page is used in a PageField, or you don't want to see some menus at all. There are many ways how you can solve that. One idea is to add a variable like "boolean m_formMode" to your PageParam (which you usually pass to the constructor of your Page), and use it within the Page to differentiate between outline and form mode. Or you could use the execInitField() method of your PageField class and call various setter-methods on your DetailForm or TablePage to enable or disable a certain feature.

I hope that gives you some ideas, how to solve your problem.

One thing to think about: Scout gives you a service-oriented architecture. Instead of re-using a Widget like a TablePage inside a Form, you could encapsulate a lot of your business logic in the server/service layer and use the same service to provide data to your TablePage or to fill a TableField within a Form. This allows to re-use code, but offers more flexibility in the way you design your user interface.

Cheers
André


Eclipse Scout Homepage | Documentation | GitHub
Re: Calling a TablePage from somewhere other than the Outline [message #1814658 is a reply to message #1814501] Mon, 16 September 2019 07:38 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
I am still struggling with one aspect in the PageWithDetailForm subject:

- I have created the TablePage and defined the DetailForm
public ExampleTablePage() {
		super(true, ExampleDetailForm.class.getName());
	}
	  
	@Override
	protected Class<? extends IForm> getConfiguredDetailForm() {
		return ExampleForm.class;
	}
	@Override
	protected void startDetailForm() {
		super.startDetailForm();
	}
	
	@Override
	protected void ensureDetailFormCreated() {
		super.ensureDetailFormCreated();
	}


- in the execAction of the EditMenue
				ExampleDetailForm form = (ExampleDetailForm) getDetailForm();
				form.setUniqueId(getUniqueIdColumn().getSelectedValue());
				form.addFormListener(new ExampleDetailFormListener());
				form.startModify();



My question is: how does the startModify() in the Detail Form has to look like, because the startInternalExclusive(new ModifyHandler()) does not work, because I am getting an error, that the form is already startet. So how do I trigger to load in the ModifyHandler or the load of the NewHandler?

Thanks!

[Updated on: Mon, 16 September 2019 07:50]

Report message to a moderator

Re: Calling a TablePage from somewhere other than the Outline [message #1814665 is a reply to message #1814658] Mon, 16 September 2019 08:12 Go to previous message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Faruk,

When you look at the source code of AbstractPageWithTable > AbstractPage you find the method ensureDetailFormStarted(), this method is called to initialize the detail form in a page. The method calls startDetailForm() which calls getDetailForm().start(); This method is intended to be overridden when you want to do something different, like call startModify() instead of start() on the form instance. So you should implement startDetailForm() in your ExampleTablePage and call getDetailForm().startModify() instead of doing the super call.

I highly recommend to take a look at the source code of Scout base classes like AbstractPage or AbstractForm as this helps to understand the "lifecycle" of these objects and what happens by default when an object appears on the screen. Almost everything in these classes is customizable to fit the specific requirements of your (and our own) Scout project(s).

André


Eclipse Scout Homepage | Documentation | GitHub
Previous Topic:Interfere right after an e.g. ListBox has been populated
Next Topic:[Neon] - insert dynamic image into menu without being icons.
Goto Forum:
  


Current Time: Wed Apr 24 20:43:47 GMT 2024

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

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

Back to the top