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
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
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
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
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.
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
ROCLASI:
Moving/copying a form from one solution to another is not possible.
Westy:
You can copy a form from one solution to another.
I stand corrected. It CAN be done.
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.
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:
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
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