Multiple floating windows

Questions and answers for designing and implementing forms in Servoy

Multiple floating windows

Postby maria » Tue Oct 12, 2010 1:54 am

Hi All,

We'd like to implement an application with multiple windows showing the same form at the same time.
Say, showing more than one customer record in identical screens floating over the main application window.
I have not dug in the question deeply but the first problem to bump into was that we cannot have one and the same form displayed in several pop-ups (correct me if I'm wrong).

I thought about creating new instances of the forms to be displayed more than once at a time but some of our forms contain a lot of others in tabs and if I'm going to have 10 customer records open in floating windows I'll have something like 200 new instances...
That doesn't sound right to me :(

Before I start to reinvent the wheel, is there an elegant solution to this?

Cheers,
Maria
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Multiple floating windows

Postby maria » Tue Oct 26, 2010 1:44 am

Um?
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Multiple floating windows

Postby Thomas Parry » Tue Oct 26, 2010 3:39 pm

um,
Have you looked at showFormInWindow - non-modal windows - would that work?
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: Multiple floating windows

Postby maria » Wed Oct 27, 2010 6:25 am

Thomas Parry wrote:um,
Have you looked at showFormInWindow - non-modal windows - would that work?


Thomas, that would certainly pop the form I need. But if it's already displayed on the main screen, the old screen will be cleared, only grey background left.
I assume it happens because Servoy uses the same instance of the form and it cannot display it in multiple windows at the same time.
This makes it impossible to open a few customer, employee, etc. records at the same time, and this is exactly what users want.

I am not sure why this topic has not received proper attention.
Either I'm missing something obvious (please help then), or there is no solution to the problem.

Cheers,
Maria
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Multiple floating windows

Postby birgit » Wed Oct 27, 2010 8:57 am

Hi

I just stepped into the same problem, last week: I would like to show a form in a dialog and that form ist already displayed as part of an other form. It grayed out. I thought about instantiating a new instance of the form for the dialog. But before continuing, I'm waiting now for the brilliant answer :D

Regards
Birgit Rieder
7r gmbh, Switzerland
SAN Developer
User avatar
birgit
 
Posts: 302
Joined: Sun Jan 15, 2006 10:04 pm
Location: Switzerland

Re: Multiple floating windows

Postby mboegem » Wed Oct 27, 2010 8:59 am

maria wrote:I am not sure why this topic has not received proper attention.
Either I'm missing something obvious (please help then), or there is no solution to the problem.


Hi Maria,

you already know the answer to what you need, I guess you won't need any input on that.

your initial question was:
Before I start to reinvent the wheel, is there an elegant solution to this?

Guess nobody did something like this before, that's why there's no repsonse

To have more instances of 1 form, you can also think about 'cloning' the form via the solutionModel.
This will create a non persistant form in the started solution per client.
If you're using smart client the workload will be on the clients machine, otherwise it will be on the application server.

If you don't want to end up with a lot of forms during 1 session, you can think of removing the forms again after use.

It's up to you whether to use your own option or the above...
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Multiple floating windows

Postby david » Wed Oct 27, 2010 9:11 pm

maria wrote:Thomas, that would certainly pop the form I need. But if it's already displayed on the main screen, the old screen will be cleared, only grey background left.
I assume it happens because Servoy uses the same instance of the form and it cannot display it in multiple windows at the same time.
This makes it impossible to open a few customer, employee, etc. records at the same time, and this is exactly what users want.

I am not sure why this topic has not received proper attention.


The fact that you can't have the same form showing at the same time got a lot of attention about 7 years ago. It has been this way from the beginning -- welcome to the party :)

We now have the solution model and clone form.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Multiple floating windows

Postby maria » Thu Oct 28, 2010 12:43 am

Thank you all guys for replies. Sad news is better than silence :)

Is it possible that Servoy will handle the cloning automagically any time in future?
If the problem came up 7 years ago and the solution is not already there, I guess there's little hope?

Cheers,
Maria
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Multiple floating windows

Postby mboegem » Thu Oct 28, 2010 1:20 am

maria wrote:If the problem came up 7 years ago and the solution is not already there, I guess there's little hope?


As David & I mentioned, there's a wonderful solution: the solutionModel cloneForm function.
In fact, the whole solutionModel is just great, it gives you - almost - full control over the blueprint of your solution at runtime.

There are many examples of full solutions being created from just a databasetable.
The whole thing is fast as lightening so the work that needs to be done is barely noticeable.

about 2 years ago I've seen Scott Buttler creating a form setup as a list kind of view, showing 1 out of 4 forms for each listed record.
This way he created a very workable overview for his customer, where - based on the type of record - a corresponding form was showing the fields holding the data for that type of record. This situation was at least as complex as you require right now.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Multiple floating windows

Postby david » Thu Oct 28, 2010 2:21 am

Another example -- Robert's recently released gantt chart is a most impressive display of solution model code:

http://www.servoyforge.net/projects/mod-gantt

To add to/reiterate Marc's thoughts , once you get into Solution Model you won't ever go back.

When Solution Model first came out with Servoy 4 we put out code for de-construction and re-construction of an entire form. The Solution Model has evolved a LOT since then but the code is still worth a look:

http://forum.servoy.com/viewtopic.php?f ... 272#p57829

Servoy's response/solution to not being able to show multiple copies of the same form at the same time is hardly sad news :) Just get some reusable solution model code into your toolbox and you can do that and so much more.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Multiple floating windows

Postby jcompagner » Thu Oct 28, 2010 10:42 am

i do have a case on my name where you can say to the tab in a tabpanel that it has to be its own instance.
I have to look when i come around that, maybe 6 but it could be after 6

Then you can just place a form in a tab and there in that form also tabs with forms and so on.
And if you create the main tab with that first tabpanel all forms are then there own instances.

What does change for this.. is that you can't address the forms in the tabs with forms.xxxx.controller....
Because that is then only the main form instance not the one in the tabs.

This is the same problem as above if you show in 2 windows the same form (customers) which one do you target if you say:
forms.customers in scripting?

So even if i fix the case for the instance tabs, you still can't have a main tab shown twice (without clone or newFormInstance)
But if you use newFormInstance for the main form, then everything down below would have been its own copy/instance at once.

So how to target instance tabs in tabpanels?

elements.tabpanel.tabname.controller.loadRecords()
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Multiple floating windows

Postby maria » Fri Oct 29, 2010 2:01 am

jcompagner wrote:What does change for this.. is that you can't address the forms in the tabs with forms.xxxx.controller....
Because that is then only the main form instance not the one in the tabs.


Why can't we get the form name from elements.tabpanel.getTabFormNameAt(i)? I would assume that this command brings the real instance's name.
maria
 
Posts: 424
Joined: Thu Apr 16, 2009 1:18 am
Location: Sydney

Re: Multiple floating windows

Postby hsummerhays » Fri Mar 04, 2011 10:11 pm

Here is a related topic: viewtopic.php?t=15732
Hugh Summerhays
Mainstream Data
hsummerhays
 
Posts: 29
Joined: Tue Mar 01, 2011 6:12 pm
Location: SLC, UT, USA

Re: Multiple floating windows

Postby amcgilly » Tue Aug 20, 2013 9:06 am

I just wrote this article for Servoy Magazine on this topic. The article provides a technique for opening the same form simultaneously in multiple windows.

Edit: The technique works even when the form has tabpanels, even when you need to put code in the main form that references the tabpanels, or vice versa. That last part is usually a challenge because when you start cloning forms, the clones acquire new names and that can break code.

I hope some developers find it helpful.
Last edited by amcgilly on Tue Aug 20, 2013 4:33 pm, edited 1 time in total.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Multiple floating windows

Postby Peter de Groot » Tue Aug 20, 2013 9:25 am

Hi all,

I use
Code: Select all
solutionModel.cloneForm()
for a while now (svy7+) and it works great,
clone_window.png
clone_window.png (28.77 KiB) Viewed 8526 times


Drum, Superheater, evap, reheat ect. are 1 and the same form cloned as many times as needed.

Regards,

Peter
User avatar
Peter de Groot
 
Posts: 215
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...

Next

Return to Forms

Who is online

Users browsing this forum: No registered users and 22 guests

cron