Moving form to other solution

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Moving form to other solution

Postby birgit » Fri Jul 07, 2006 5:17 pm

Hi

I'd like to have the possibility to move a form to an other solution.

Or am I missing something? Is there already an easy way to do so?

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

Postby grahamg » Fri Jul 07, 2006 6:18 pm

Hi Birgit

Haven't tried it but could you transfer Forms via a Module if the Module is accessed by both Solutions?


Regards

Graham Greensall
Worxinfo Ltd
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Postby birgit » Sat Jul 08, 2006 10:57 pm

Hi

Sorry, but I don't get your suggestion. Maybe we dont' talk about the same?

I have a form defined in one solution. But now I would like to have it defined in an other solution. What I do is, I create a new form and define all the graphic parts again in the designer and copy all methods from the old form. This is much work. So I'm looking for an easy way to move the form to the other solution.

I would be happy if you could explain your idea in other words or in more detail. Thank you and kind regards

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

Postby ROCLASI » Sun Jul 09, 2006 12:17 pm

Hi Birgit,

Moving/copying a form from one solution to another is not possible.

But what you CAN do is reuse a form and all it's methods.
You can do this my loading the solution with the form you want to reuse as a module in your other solution (see under Solution Settings).
This way you can reuse any form from the loaded module in your new solution.

But be adviced. Working with Modules brings it's own set of rules with it.
Form names, global methodnames have to be unique.
Global variables can be the same name as long as they are of the same type, same goes for relationships.
The servoy manual covers all this.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Postby Westy » Sun Jul 09, 2006 10:23 pm

You can copy a form from one solution to another. For example, to copy a form from solution B to solution A, first open solution B. Then from the File/Solution Settings pulldown, make solution B a module. Next open solution A. Then attach the solution B module to solution A (from same Solution Settings dialog). Then close and re-open solution A and select the solution B form that you want to copy from the Window pulldown menu. Then select "Duplicate Form" from the File menu. The form from solution B will be copied into solution A. As long as you follow the naming conventions required for modules, it works.

Dean
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Postby ROCLASI » Mon Jul 10, 2006 7:26 am

ROCLASI wrote:Moving/copying a form from one solution to another is not possible.
Westy wrote:You can copy a form from one solution to another.


I stand corrected. It CAN be done. :D

By the way, you can't access the loaded module forms in designer mode.
So select the form from the window menu and then select Duplicate Form.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Postby birgit » Mon Jul 10, 2006 10:36 am

Dean

Thank you for this hint! I din't notice that I can duplicate a form to a loaded module. I thought it can only be copied to the "active" solution. I'll give it a try.

If I remember correctly, duplicating does not copy the whole form: The methods I defined in the designer and are triggered e.g. onLoad are not copied. Is this correct? And why do I loose this information?

Robert Ivens, thank you for your reply. Using the form from a loaded module would not solve my problem since the solution the form is defined in became the wrong solution. Sometimes I need to restructure my code. Methods are moved to other forms, forms are redesigned and sometimes should be located in other solutions. So, an easy "moving" is important to me.

Best regards and thanks for the replies
Birgit
Birgit Rieder
7r gmbh, Switzerland
SAN Developer
User avatar
birgit
 
Posts: 302
Joined: Sun Jan 15, 2006 10:04 pm
Location: Switzerland

Postby swingman » Mon Jul 10, 2006 10:46 am

birgit wrote:If I remember correctly, duplicating does not copy the whole form: The methods I defined in the designer and are triggered e.g. onLoad are not copied. Is this correct? And why do I loose this information?


The methods are not duplicated automatically to the new form. This is a bit annoying -- but there is a good workaround which encourages reuse.

Make sure that your forms trigger global mehods wherever possible -- these links are retained when duplicating forms.

If you search the forum, you will find some old posts where I complained that I had to duplicate 7 methods for each form I was creating. After an extensive redesign I managed to make them all global and to put them into a module so this is no longer an issue.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Postby birgit » Mon Jul 10, 2006 11:16 am

Christian Batchelor

Thank you. I didn't know that global methods are kept when duplicating a form. Why is this the case? Is this documented?

On the other side: I try to avoid globals (methods and variables). And I don't like to introduce them to make duplication easier. I prefer a better copy method from servoy. Or a reason why the (local) methods are lost.

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


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 12 guests