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?
Thomas Parry:
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.
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
maria:
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…
maria:
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
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?
maria:
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.
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:
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.
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.
jcompagner:
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.
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.
[attachment=0]clone_window.png[/attachment]
Drum, Superheater, evap, reheat ect. are 1 and the same form cloned as many times as needed.
Regards,
Peter

That looks great. However if you then cloned your main form using solutionModel.cloneForm() and opened several instances of it at once you’d find that your tabpanels stop working in all but the most recently opened clone. Also if you need to put code in your main form that references the tabpanels (or vice versa) and you want that code to work in the clones, that can be a challenge because the clones will all have acquired new names. Those are the problems for which I have proposed solutions in my article.
That looks great. However if you then cloned your main form using solutionModel.cloneForm() and opened several instances of it at once you’d find that your tabpanels stop working in all but the most recently opened clone. Also if you need to put code in your main form that references the tabpanels (or vice versa) and you want that code to work in the clones, that can be a challenge because the clones will all have acquired new names. Those are the problems for which I have proposed solutions in my article.
+1
Handling one form in multiple windows is easy. Beyond that…takes some “extra-thought-sauce” as we say around here.
I have heard somewhere, that cloning with parent tab’s is somewhere on the roadmap…
Could’nt find it (searched quickly in the support system) so quickly, so maybe someone of Servoy can comment on this one
It is a proposed Feature Request, but as there is a viable solution already and the proposed FR has quite a large impact on how you develop your solutions, the FR is not very high on the roadmap.
I’ve used the clone process, but the cloned form updates both records from either list view.
I’ve attemped to set use clone.useSeparateFoundSet = true, but that leaves the original function intact. In the clone, the list view is selectable but the record isn’t updating.
Once a form is cloned, the function that sets the index on the individual record view from a list view doesn’t fire. The onSelectionRecord must be explicitly identified to set the index on the record view.