method arguments

Questions, answers, tips and ideas on Servoy Client

method arguments

Postby lesouef » Thu Mar 20, 2008 12:09 am

when launching the client with script execution and arguments, how to recuperate the 2nd argument in the method?
the doc show this:
http://localhost:8080/servoy-client/ser ... &rnd=12302
but does not say how to get 'rnd=12302', the last member of the URL?
lesouef
 
Posts: 420
Joined: Thu Oct 20, 2005 8:13 pm
Location: Strasbourg & Paris - France

Postby IT2Be » Thu Mar 20, 2008 9:00 am

That link does not work, it is from a local host :)
So I do not know the content but normally fetching arguments is the same as reading out an array.
arguments[0] = first, arguments[1] = second etc...

Hope this is what you were looking for, otherwise please paste (part of) the text...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby lesouef » Thu Mar 20, 2008 9:40 am

it was just a syntax example, but it is supposed to work with the crm example if your port is also 8080.
the method does not exist in the crm solution, so there is no way to guess how they got the 2nd argument.
I agree it should argument[n], but obviously it's not, only [0] seems to be passed to the method.
I also checked to form crm 2.2 example, same...
lesouef
 
Posts: 420
Joined: Thu Oct 20, 2005 8:13 pm
Location: Strasbourg & Paris - France

Postby IT2Be » Thu Mar 20, 2008 9:47 am

hmm, ok. I don't have the crm installed right now so I have to pass.

Maybe somebody else can help you...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Thu Mar 20, 2008 12:52 pm

You can only deeplink with 1 argument. If you want to send in multiple arguments, you have to concatenate them together into 1 string

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby dpearce » Fri Mar 21, 2008 4:13 pm

so are you saying that argument[0] is the only string you can bring in from a URL?

http://localhost:8080/servoy-client/ser ... ents=10444

and if you want to bring in two variables you would have to use a deliminator and then cut up the string, so something like

http://localhost:8080/servoy-client/ser ... 4|abds|def

and then split the arguments[0] by splitting at '|'

or is there a way to bring in multiple arguments from one URL?

david
dpearce
 
Posts: 469
Joined: Sun Dec 03, 2006 11:53 am

Postby pbakker » Fri Mar 21, 2008 4:15 pm

so are you saying that argument[0] is the only string you can bring in from a URL?

http://localhost:8080/servoy-client/ser ... ents=10444

and if you want to bring in two variables you would have to use a deliminator and then cut up the string, so something like

http://localhost:8080/servoy-client/ser ... 4|abds|def

and then split the arguments[0] by splitting at '|'


Correct
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby dpearce » Fri Mar 21, 2008 4:18 pm

wow quick response!

i assume this works for webclient as well?

is it one variable or does it always have to be called arguments=blablabla

and then captured as arguments[0] like calling a method from another?

Thanks
dpearce
 
Posts: 469
Joined: Sun Dec 03, 2006 11:53 am

Postby pbakker » Fri Mar 21, 2008 4:20 pm

yes
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby dpearce » Fri Mar 21, 2008 4:31 pm

OK, I have got it

for webclient it is

http://localhost:8080/servoy-webclient/ ... orargument

that does it!
dpearce
 
Posts: 469
Joined: Sun Dec 03, 2006 11:53 am


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 13 guests