# parameter passed with the Smartclient URL

**URL:** https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649
**Category:** Classic Servoy
**Created:** [September 13, 2011, 4:07pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649 "2011-09-13T16:07:28Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![stefanoni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@stefanoni](https://forum.servoy.com/u/stefanoni)
#### Post date: [September 13, 2011, 4:07pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/1 "2011-09-13T16:07:28Z")

</div>

I tried to pass a parameter with the Smartclient URL, but no success.

The wicki says :  
{serverUrl}/servoy-client/mySolutionName.jnlp? **a={value}**  
Opens a Smart Client and launches the specified solution. The argument value is passed into the Solutions **onOpen event handler**.

- does it arrive onOpen of the solution, or onOpen of the loginSolutionName ?
- does this arrive as a named parameter ( **a** in this example), or is this something like event.getParameter(‘a’) ?

Thank you for help.

---

<div class="post-metadata">

### Author: ![stefanoni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@stefanoni](https://forum.servoy.com/u/stefanoni)
#### Post date: [September 19, 2011, 2:33pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/2 "2011-09-19T14:33:00Z")

</div>

After 1 Week with no answers, I need to know if the question is understandable, or if maybe it’s not really common, to pass a parameter with  
the servoy url ?

Thank you for a feedback

---

<div class="post-metadata">

### Author: ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)
#### Post date: [September 19, 2011, 2:49pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/3 "2011-09-19T14:49:07Z")

</div>

You receive it in the arguments array.

---

<div class="post-metadata">

### Author: ![stefanoni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@stefanoni](https://forum.servoy.com/u/stefanoni)
#### Post date: [September 19, 2011, 3:48pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/4 "2011-09-19T15:48:19Z")

</div>

> ptalbot:  
> You receive it in the arguments array.

Thank you for answer. I think that’s what I’m not familiar with.

In the onOpen-property of the solution I typed **globals.setEnvironment(argsArray)**

the firs statement in globals.setEnvironment(argsArray) is **application.output(argsArray, LOGGINGLEVEL.ERROR)** and  
the result of this (javaconsole) is: **undefined**

The Link looks like:  
http://???.???.???.???:8080/servoy-client/GigDoodle.jnlp?userid=test

What do I wrong ?

---

<div class="post-metadata">

### Author: ![ptalbot](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/ptalbot/32/4952_2.png) [@ptalbot](https://forum.servoy.com/u/ptalbot)
#### Post date: [September 19, 2011, 3:57pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/5 "2011-09-19T15:57:54Z")

</div>

This is standard JavaScript. The arguments array is a special variable passed to your methods.  
You access it with its name, which is ‘arguments’ so for example:

```auto
if (arguments && arguments.length > 0) {
    application.output(arguments[0], LOGGINGLEVEL.INFO);
}

```

---

<div class="post-metadata">

### Author: ![stefanoni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@stefanoni](https://forum.servoy.com/u/stefanoni)
#### Post date: [September 19, 2011, 4:45pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/6 "2011-09-19T16:45:41Z")

</div>

Patrick,  
I tried

application.output(arguments[0], LOGGINGLEVEL.INFO)

in the onOpen of the solution , but receive still **undefined**  
in the onOpen of the LoginSolution , but receive **undefined** too.

Does some security stuff on the server 2008 r2, or some enhanced security stuff from  
servoy, influence the passing of a parameter ?

Is the link I showed above a correct syntax (wondering if the **Named** parameter in the wicki “ **a** ” is  
necessary, but the receiving is just a array-position)?

Thank you for your help

---

<div class="post-metadata">

### Author: ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)
#### Post date: [September 19, 2011, 8:31pm UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/7 "2011-09-19T20:31:32Z")

</div>

> stefanoni:  
> in the onOpen of the solution , but receive still undefined  
> in the onOpen of the LoginSolution , but receive undefined too.

If I remember correctly, you have to specify a global method in the deeplink as well.  
Otherwise the parameters will not be passed correctly.

I used an ‘empty’ global method as a placeholder. The method itself just doesn’t do anything.

```auto
function login(){ //placeholder method }

```

The deeplink should look like:

```auto
{serverUrl}/servoy-client/mySolutionName.jnlp?m=login&a={value}

```

Please be aware that using a deeplink, java won’t create a shortcut on your desktop anymore (if you used this before)  
This can be solved by using the ‘profiles’ in Servoy Admin pages.

Hope this helps

---

<div class="post-metadata">

### Author: ![stefanoni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@stefanoni](https://forum.servoy.com/u/stefanoni)
#### Post date: [September 20, 2011, 9:30am UTC](https://forum.servoy.com/t/parameter-passed-with-the-smartclient-url/14649/8 "2011-09-20T09:30:19Z")

</div>

Now I got it, thank you !

So your suggestion :

> mboegem:  
> If I remember correctly, you have to specify a global method in the deeplink as well.  
> Otherwise the parameters will not be passed correctly.

What I experianced:  
The placeholder method is **not** necessary for a single parameter, but the letter **a**!  
The **a** means “argument” and has a different meaning then in a html/php link, where  
the letter(s) left the **=** are the name of a parameter.

> mboegem:  
> The deeplink should look like: ```  
> {serverUrl}/servoy-client/mySolutionName.jnlp?m=login&a={value}
> 
> ```auto
> 
> ```

Yeas, this is the right way if you like to start a specific method and pass a parameter, because  
de letters **m** means method and the **a** means argument.

But my link now looks like ```  
{serverUrl}/servoy-client/mySolutionName.jnlp?a={value}

```and
- in the onSolutionOpen of the loginSolutionName of the solution
- in the onSolutionOpen of the solution itself

Thank you @all for your patience !
Regards
```
