application.closeSolution load a new solution with a method

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

application.closeSolution load a new solution with a method

Postby axterics » Tue May 20, 2008 10:53 am

Function closeSolution
Description Closes the currently open solution; can also include an argument to load (and open) a
specified solution when the currently active solution is closed.
Syntax
application.closeSolution([solution_to_load],[method],[argument]
)
Parameters
solution_to_load - the specified solution to load when the currently active
solution is closed; optional.
method - the specified method run from the currently active solution; optional.
argument - the argument for the specified method; optional.


application.closeSolution([solution_to_load],[method],[argument]
)

[method],[argument] are referred to the currently open solution (I can't understand why, I can simply call a method before call the closeSolution)

My feauture request is to change this behaviour and open the method in the solution that I go to load as first argument.

Anyone interested?
Do you confirm this behavior?
axterics
 
Posts: 122
Joined: Wed Feb 07, 2007 9:44 am
Location: Verona, Italy

Postby Harjo » Tue May 20, 2008 12:52 pm

As far as I know, the information is not right, the method and the arguments are for the new opened solution.

We use it that way, and it just works.

Did you already tried it?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby axterics » Wed May 21, 2008 9:49 am

Harjo how do you pass the method and arguments? The method must be global?

I use
application.closeSolution('mySolution', 'forms.myForm._dev_test', 'test')

where forms.myForm._dev_test simply do a plugins.dialogs.showInfoDialog('',arguments[0])

and the mySolution is loaded but no msgbox appear...
axterics
 
Posts: 122
Joined: Wed Feb 07, 2007 9:44 am
Location: Verona, Italy

Postby ROCLASI » Wed May 21, 2008 10:10 am

Hi axterics,
axterics wrote:application.closeSolution('mySolution', 'forms.myForm._dev_test', 'test')

Method objects are usually passed without using quotes.
So your code should probably look like this:
Code: Select all
application.closeSolution('mySolution', forms.myForm._dev_test,  'test')


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 axterics » Wed May 21, 2008 5:10 pm

Without quote:

The undefined value has no properties calling _dev_test.
axterics
 
Posts: 122
Joined: Wed Feb 07, 2007 9:44 am
Location: Verona, Italy

Postby grahamg » Wed May 21, 2008 8:35 pm

Have you tried setting the form name into a variable first - seem to recall this worked for me in a similar situation:

Code: Select all
var vFormName = 'forms.myForm._dev_test';

application.closeSolution('mySolution', vFormName,  'test')
Graham Greensall
Worxinfo Ltd
www.worxinfo.com
grahamg
 
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Postby ROCLASI » Wed May 21, 2008 9:49 pm

Hmm..I can't get any method to trigger using this function. String, variable, form method, global method or otherwise.
I tested this on Servoy Version 3.5.6-build 519, Java version 1.5.0_13-119 (Mac OS X) and Java version 10.0-b19 (Windows XP).

Harjo, do you use the method part of this function and if so does it work for you ?
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 Harjo » Thu May 22, 2008 9:38 am

I have build this in Servoy 3.1.6

Code: Select all
application.closeSolution('myOtherSolution','GetCookie', 543671); //Attention: calling arguments only work in client!!


and it works! :-)
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby axterics » Thu May 22, 2008 10:23 am

Your 'GetCookie' function is on the the "First Form" of the new loaded solution?

Can you test this on a 3.5.x version?

Can you call a function that simply do a plugins.dialog.showInfoDialog('',arguments[0])
in either servoy version?
axterics
 
Posts: 122
Joined: Wed Feb 07, 2007 9:44 am
Location: Verona, Italy

Postby Harjo » Thu May 22, 2008 10:26 am

no, getCookie is a global method!

I can't test this right now on 3.5, sorry.....
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby axterics » Thu May 22, 2008 12:14 pm

SOLVED.
Works also in 3.5.x release.
The method (e.g. GetCookie) must be a global method in the new loaded solution.


Code: Select all
application.closeSolution('myOtherSolution','GetCookie', 543671);


ATTENTION
Don't work in developer where the new solution appear but without calling any method whereas works perfectly on Servoy client.


If someone can move this thread in the section developer.methods I think can be useful for the future
axterics
 
Posts: 122
Joined: Wed Feb 07, 2007 9:44 am
Location: Verona, Italy


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 10 guests